Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: omap1: remove unused board files

All board support that was marked as 'unused' earlier can
now be removed, leaving the five machines that that still
had someone using them in 2022, or that are supported in
qemu.

Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: linux-omap@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+9 -4256
-2
MAINTAINERS
··· 15263 15263 T: git git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git 15264 15264 F: arch/arm/configs/omap1_defconfig 15265 15265 F: arch/arm/mach-omap1/ 15266 - F: arch/arm/plat-omap/ 15267 15266 F: drivers/i2c/busses/i2c-omap.c 15268 15267 F: include/linux/platform_data/ams-delta-fiq.h 15269 15268 F: include/linux/platform_data/i2c-omap.h ··· 15277 15278 T: git git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git 15278 15279 F: arch/arm/configs/omap2plus_defconfig 15279 15280 F: arch/arm/mach-omap2/ 15280 - F: arch/arm/plat-omap/ 15281 15281 F: drivers/bus/ti-sysc.c 15282 15282 F: drivers/i2c/busses/i2c-omap.c 15283 15283 F: drivers/irqchip/irq-omap-intc.c
+6 -30
arch/arm/Kconfig.debug
··· 760 760 depends on ARCH_OMAP2PLUS 761 761 select DEBUG_UART_8250 762 762 763 - config DEBUG_OMAP7XXUART1 764 - bool "Kernel low-level debugging via OMAP730 UART1" 765 - depends on ARCH_OMAP730 766 - select DEBUG_UART_8250 767 - help 768 - Say Y here if you want kernel low-level debugging support 769 - on OMAP730 based platforms on the UART1. 770 - 771 - config DEBUG_OMAP7XXUART2 772 - bool "Kernel low-level debugging via OMAP730 UART2" 773 - depends on ARCH_OMAP730 774 - select DEBUG_UART_8250 775 - help 776 - Say Y here if you want kernel low-level debugging support 777 - on OMAP730 based platforms on the UART2. 778 - 779 - config DEBUG_OMAP7XXUART3 780 - bool "Kernel low-level debugging via OMAP730 UART3" 781 - depends on ARCH_OMAP730 782 - select DEBUG_UART_8250 783 - help 784 - Say Y here if you want kernel low-level debugging support 785 - on OMAP730 based platforms on the UART3. 786 - 787 763 config DEBUG_TI81XXUART1 788 764 bool "Kernel low-level debugging messages via TI81XX UART1 (ti8148evm)" 789 765 depends on ARCH_OMAP2PLUS ··· 1704 1728 default 0xffe40000 if DEBUG_RCAR_GEN1_SCIF0 1705 1729 default 0xffe42000 if DEBUG_RCAR_GEN1_SCIF2 1706 1730 default 0xfff36000 if DEBUG_HIGHBANK_UART 1707 - default 0xfffb0000 if DEBUG_OMAP1UART1 || DEBUG_OMAP7XXUART1 1708 - default 0xfffb0800 if DEBUG_OMAP1UART2 || DEBUG_OMAP7XXUART2 1709 - default 0xfffb9800 if DEBUG_OMAP1UART3 || DEBUG_OMAP7XXUART3 1731 + default 0xfffb0000 if DEBUG_OMAP1UART1 1732 + default 0xfffb0800 if DEBUG_OMAP1UART2 1733 + default 0xfffb9800 if DEBUG_OMAP1UART3 1710 1734 default 0xfffe8600 if DEBUG_BCM63XX_UART 1711 1735 default 0xffffee00 if DEBUG_AT91_SAM9263_DBGU 1712 1736 default 0xfffff200 if DEBUG_AT91_RM9200_DBGU ··· 1823 1847 default 0xfec00000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN 1824 1848 default 0xfec00003 if ARCH_IXP4XX && CPU_BIG_ENDIAN 1825 1849 default 0xfef36000 if DEBUG_HIGHBANK_UART 1826 - default 0xff0b0000 if DEBUG_OMAP1UART1 || DEBUG_OMAP7XXUART1 1827 - default 0xff0b0800 if DEBUG_OMAP1UART2 || DEBUG_OMAP7XXUART2 1828 - default 0xff0b9800 if DEBUG_OMAP1UART3 || DEBUG_OMAP7XXUART3 1850 + default 0xff0b0000 if DEBUG_OMAP1UART1 1851 + default 0xff0b0800 if DEBUG_OMAP1UART2 1852 + default 0xff0b9800 if DEBUG_OMAP1UART3 1829 1853 default 0xffd01000 if DEBUG_HIP01_UART 1830 1854 default DEBUG_UART_PHYS if !MMU 1831 1855 depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \
-2
arch/arm/configs/omap1_defconfig
··· 20 20 CONFIG_ARCH_OMAP1=y 21 21 CONFIG_OMAP_32K_TIMER=y 22 22 CONFIG_OMAP_DM_TIMER=y 23 - CONFIG_ARCH_OMAP730=y 24 - CONFIG_ARCH_OMAP850=y 25 23 CONFIG_ARCH_OMAP16XX=y 26 24 # CONFIG_OMAP_MUX is not set 27 25 CONFIG_OMAP_RESET_CLOCKS=y
-91
arch/arm/mach-omap1/Kconfig
··· 19 19 20 20 comment "OMAP Core Type" 21 21 22 - config ARCH_OMAP730 23 - depends on ARCH_MULTI_V5 24 - bool "OMAP730 Based System" 25 - select ARCH_OMAP_OTG 26 - select CPU_ARM926T 27 - select OMAP_MPU_TIMER 28 - 29 - config ARCH_OMAP850 30 - depends on ARCH_MULTI_V5 31 - bool "OMAP850 Based System" 32 - select ARCH_OMAP_OTG 33 - select CPU_ARM926T 34 - 35 22 config ARCH_OMAP15XX 36 23 depends on ARCH_MULTI_V4T 37 24 default y ··· 113 126 114 127 comment "OMAP Board Type" 115 128 116 - config MACH_OMAP_INNOVATOR 117 - bool "TI Innovator" 118 - depends on ARCH_OMAP15XX || ARCH_OMAP16XX 119 - depends on UNUSED_BOARD_FILES 120 - help 121 - TI OMAP 1510 or 1610 Innovator board support. Say Y here if you 122 - have such a board. 123 - 124 - config MACH_OMAP_H2 125 - bool "TI H2 Support" 126 - depends on ARCH_OMAP16XX 127 - depends on UNUSED_BOARD_FILES 128 - help 129 - TI OMAP 1610/1611B H2 board support. Say Y here if you have such 130 - a board. 131 - 132 - config MACH_OMAP_H3 133 - bool "TI H3 Support" 134 - depends on ARCH_OMAP16XX 135 - depends on UNUSED_BOARD_FILES 136 - help 137 - TI OMAP 1710 H3 board support. Say Y here if you have such 138 - a board. 139 - 140 - config MACH_HERALD 141 - bool "HTC Herald" 142 - depends on ARCH_OMAP850 143 - depends on UNUSED_BOARD_FILES 144 - help 145 - HTC Herald smartphone support (AKA T-Mobile Wing, ...) 146 - 147 129 config MACH_OMAP_OSK 148 130 bool "TI OSK Support" 149 131 depends on ARCH_OMAP16XX ··· 123 167 config OMAP_OSK_MISTRAL 124 168 bool "Mistral QVGA board Support" 125 169 depends on MACH_OMAP_OSK 126 - depends on UNUSED_BOARD_FILES 127 170 help 128 171 The OSK supports an optional add-on board with a Quarter-VGA 129 172 touchscreen, PDA-ish buttons, a resume button, bicolor LED, 130 173 and camera connector. Say Y here if you have this board. 131 - 132 - config MACH_OMAP_PERSEUS2 133 - bool "TI Perseus2" 134 - depends on ARCH_OMAP730 135 - depends on UNUSED_BOARD_FILES 136 - help 137 - Support for TI OMAP 730 Perseus2 board. Say Y here if you have such 138 - a board. 139 - 140 - config MACH_OMAP_FSAMPLE 141 - bool "TI F-Sample" 142 - depends on ARCH_OMAP730 143 - depends on UNUSED_BOARD_FILES 144 - help 145 - Support for TI OMAP 850 F-Sample board. Say Y here if you have such 146 - a board. 147 174 148 175 config MACH_OMAP_PALMTE 149 176 bool "Palm Tungsten E" ··· 135 196 Support for the Palm Tungsten E PDA. To boot the kernel, you'll 136 197 need a PalmOS compatible bootloader; check out 137 198 http://palmtelinux.sourceforge.net/ for more information. 138 - Say Y here if you have this PDA model, say N otherwise. 139 - 140 - config MACH_OMAP_PALMZ71 141 - bool "Palm Zire71" 142 - depends on ARCH_OMAP15XX 143 - depends on UNUSED_BOARD_FILES 144 - help 145 - Support for the Palm Zire71 PDA. To boot the kernel, 146 - you'll need a PalmOS compatible bootloader; check out 147 - http://hackndev.com/palm/z71 for more information. 148 - Say Y here if you have such a PDA, say N otherwise. 149 - 150 - config MACH_OMAP_PALMTT 151 - bool "Palm Tungsten|T" 152 - depends on ARCH_OMAP15XX 153 - depends on UNUSED_BOARD_FILES 154 - help 155 - Support for the Palm Tungsten|T PDA. To boot the kernel, you'll 156 - need a PalmOS compatible bootloader (Garux); check out 157 - http://garux.sourceforge.net/ for more information. 158 199 Say Y here if you have this PDA model, say N otherwise. 159 200 160 201 config MACH_SX1 ··· 167 248 help 168 249 Support for the Amstrad E3 (codename Delta) videophone. Say Y here 169 250 if you have such a device. 170 - 171 - config MACH_OMAP_GENERIC 172 - bool "Generic OMAP board" 173 - depends on ARCH_OMAP15XX || ARCH_OMAP16XX 174 - depends on UNUSED_BOARD_FILES 175 - help 176 - Support for generic OMAP-1510, 1610 or 1710 board with 177 - no FPGA. Can be used as template for porting Linux to 178 - custom OMAP boards. Say Y here if you have a custom 179 - board. 180 251 181 252 endmenu 182 253
-18
arch/arm/mach-omap1/Makefile
··· 29 29 obj-y += $(usb-fs-m) $(usb-fs-y) 30 30 31 31 # Specific board support 32 - obj-$(CONFIG_MACH_OMAP_H2) += board-h2.o board-h2-mmc.o \ 33 - board-nand.o 34 - obj-$(CONFIG_MACH_OMAP_INNOVATOR) += board-innovator.o 35 - obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o 36 - obj-$(CONFIG_MACH_OMAP_PERSEUS2) += board-perseus2.o board-nand.o 37 - obj-$(CONFIG_MACH_OMAP_FSAMPLE) += board-fsample.o board-nand.o 38 32 obj-$(CONFIG_MACH_OMAP_OSK) += board-osk.o 39 - obj-$(CONFIG_MACH_OMAP_H3) += board-h3.o board-h3-mmc.o \ 40 - board-nand.o 41 33 obj-$(CONFIG_MACH_OMAP_PALMTE) += board-palmte.o 42 - obj-$(CONFIG_MACH_OMAP_PALMZ71) += board-palmz71.o 43 - obj-$(CONFIG_MACH_OMAP_PALMTT) += board-palmtt.o 44 34 obj-$(CONFIG_MACH_NOKIA770) += board-nokia770.o 45 35 obj-$(CONFIG_MACH_AMS_DELTA) += board-ams-delta.o ams-delta-fiq.o \ 46 36 ams-delta-fiq-handler.o 47 37 obj-$(CONFIG_MACH_SX1) += board-sx1.o board-sx1-mmc.o 48 - obj-$(CONFIG_MACH_HERALD) += board-htcherald.o 49 - 50 - ifeq ($(CONFIG_ARCH_OMAP15XX),y) 51 - # Innovator-1510 FPGA 52 - obj-$(CONFIG_MACH_OMAP_INNOVATOR) += fpga.o 53 - endif 54 38 55 39 # GPIO 56 - obj-$(CONFIG_ARCH_OMAP730) += gpio7xx.o 57 - obj-$(CONFIG_ARCH_OMAP850) += gpio7xx.o 58 40 obj-$(CONFIG_ARCH_OMAP15XX) += gpio15xx.o 59 41 obj-$(CONFIG_ARCH_OMAP16XX) += gpio16xx.o
-366
arch/arm/mach-omap1/board-fsample.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * linux/arch/arm/mach-omap1/board-fsample.c 4 - * 5 - * Modified from board-perseus2.c 6 - * 7 - * Original OMAP730 support by Jean Pihet <j-pihet@ti.com> 8 - * Updated for 2.6 by Kevin Hilman <kjh@hilman.org> 9 - */ 10 - #include <linux/gpio.h> 11 - #include <linux/kernel.h> 12 - #include <linux/init.h> 13 - #include <linux/platform_device.h> 14 - #include <linux/delay.h> 15 - #include <linux/mtd/mtd.h> 16 - #include <linux/mtd/platnand.h> 17 - #include <linux/mtd/physmap.h> 18 - #include <linux/input.h> 19 - #include <linux/smc91x.h> 20 - #include <linux/omapfb.h> 21 - 22 - #include <asm/mach-types.h> 23 - #include <asm/mach/arch.h> 24 - #include <asm/mach/map.h> 25 - 26 - #include <linux/soc/ti/omap1-io.h> 27 - #include <linux/platform_data/keypad-omap.h> 28 - #include "tc.h" 29 - 30 - #include "mux.h" 31 - #include "flash.h" 32 - #include "hardware.h" 33 - #include "iomap.h" 34 - #include "common.h" 35 - #include "fpga.h" 36 - 37 - /* fsample is pretty close to p2-sample */ 38 - 39 - #define fsample_cpld_read(reg) __raw_readb(reg) 40 - #define fsample_cpld_write(val, reg) __raw_writeb(val, reg) 41 - 42 - #define FSAMPLE_CPLD_BASE 0xE8100000 43 - #define FSAMPLE_CPLD_SIZE SZ_4K 44 - #define FSAMPLE_CPLD_START 0x05080000 45 - 46 - #define FSAMPLE_CPLD_REG_A (FSAMPLE_CPLD_BASE + 0x00) 47 - #define FSAMPLE_CPLD_SWITCH (FSAMPLE_CPLD_BASE + 0x02) 48 - #define FSAMPLE_CPLD_UART (FSAMPLE_CPLD_BASE + 0x02) 49 - #define FSAMPLE_CPLD_REG_B (FSAMPLE_CPLD_BASE + 0x04) 50 - #define FSAMPLE_CPLD_VERSION (FSAMPLE_CPLD_BASE + 0x06) 51 - #define FSAMPLE_CPLD_SET_CLR (FSAMPLE_CPLD_BASE + 0x06) 52 - 53 - #define FSAMPLE_CPLD_BIT_BT_RESET 0 54 - #define FSAMPLE_CPLD_BIT_LCD_RESET 1 55 - #define FSAMPLE_CPLD_BIT_CAM_PWDN 2 56 - #define FSAMPLE_CPLD_BIT_CHARGER_ENABLE 3 57 - #define FSAMPLE_CPLD_BIT_SD_MMC_EN 4 58 - #define FSAMPLE_CPLD_BIT_aGPS_PWREN 5 59 - #define FSAMPLE_CPLD_BIT_BACKLIGHT 6 60 - #define FSAMPLE_CPLD_BIT_aGPS_EN_RESET 7 61 - #define FSAMPLE_CPLD_BIT_aGPS_SLEEPx_N 8 62 - #define FSAMPLE_CPLD_BIT_OTG_RESET 9 63 - 64 - #define fsample_cpld_set(bit) \ 65 - fsample_cpld_write((((bit) & 15) << 4) | 0x0f, FSAMPLE_CPLD_SET_CLR) 66 - 67 - #define fsample_cpld_clear(bit) \ 68 - fsample_cpld_write(0xf0 | ((bit) & 15), FSAMPLE_CPLD_SET_CLR) 69 - 70 - static const unsigned int fsample_keymap[] = { 71 - KEY(0, 0, KEY_UP), 72 - KEY(1, 0, KEY_RIGHT), 73 - KEY(2, 0, KEY_LEFT), 74 - KEY(3, 0, KEY_DOWN), 75 - KEY(4, 0, KEY_ENTER), 76 - KEY(0, 1, KEY_F10), 77 - KEY(1, 1, KEY_SEND), 78 - KEY(2, 1, KEY_END), 79 - KEY(3, 1, KEY_VOLUMEDOWN), 80 - KEY(4, 1, KEY_VOLUMEUP), 81 - KEY(5, 1, KEY_RECORD), 82 - KEY(0, 2, KEY_F9), 83 - KEY(1, 2, KEY_3), 84 - KEY(2, 2, KEY_6), 85 - KEY(3, 2, KEY_9), 86 - KEY(4, 2, KEY_KPDOT), 87 - KEY(0, 3, KEY_BACK), 88 - KEY(1, 3, KEY_2), 89 - KEY(2, 3, KEY_5), 90 - KEY(3, 3, KEY_8), 91 - KEY(4, 3, KEY_0), 92 - KEY(5, 3, KEY_KPSLASH), 93 - KEY(0, 4, KEY_HOME), 94 - KEY(1, 4, KEY_1), 95 - KEY(2, 4, KEY_4), 96 - KEY(3, 4, KEY_7), 97 - KEY(4, 4, KEY_KPASTERISK), 98 - KEY(5, 4, KEY_POWER), 99 - }; 100 - 101 - static struct smc91x_platdata smc91x_info = { 102 - .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, 103 - .leda = RPC_LED_100_10, 104 - .ledb = RPC_LED_TX_RX, 105 - }; 106 - 107 - static struct resource smc91x_resources[] = { 108 - [0] = { 109 - .start = H2P2_DBG_FPGA_ETHR_START, /* Physical */ 110 - .end = H2P2_DBG_FPGA_ETHR_START + 0xf, 111 - .flags = IORESOURCE_MEM, 112 - }, 113 - [1] = { 114 - .start = INT_7XX_MPU_EXT_NIRQ, 115 - .end = 0, 116 - .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, 117 - }, 118 - }; 119 - 120 - static void __init fsample_init_smc91x(void) 121 - { 122 - __raw_writeb(1, H2P2_DBG_FPGA_LAN_RESET); 123 - mdelay(50); 124 - __raw_writeb(__raw_readb(H2P2_DBG_FPGA_LAN_RESET) & ~1, 125 - H2P2_DBG_FPGA_LAN_RESET); 126 - mdelay(50); 127 - } 128 - 129 - static struct mtd_partition nor_partitions[] = { 130 - /* bootloader (U-Boot, etc) in first sector */ 131 - { 132 - .name = "bootloader", 133 - .offset = 0, 134 - .size = SZ_128K, 135 - .mask_flags = MTD_WRITEABLE, /* force read-only */ 136 - }, 137 - /* bootloader params in the next sector */ 138 - { 139 - .name = "params", 140 - .offset = MTDPART_OFS_APPEND, 141 - .size = SZ_128K, 142 - .mask_flags = 0, 143 - }, 144 - /* kernel */ 145 - { 146 - .name = "kernel", 147 - .offset = MTDPART_OFS_APPEND, 148 - .size = SZ_2M, 149 - .mask_flags = 0 150 - }, 151 - /* rest of flash is a file system */ 152 - { 153 - .name = "rootfs", 154 - .offset = MTDPART_OFS_APPEND, 155 - .size = MTDPART_SIZ_FULL, 156 - .mask_flags = 0 157 - }, 158 - }; 159 - 160 - static struct physmap_flash_data nor_data = { 161 - .width = 2, 162 - .set_vpp = omap1_set_vpp, 163 - .parts = nor_partitions, 164 - .nr_parts = ARRAY_SIZE(nor_partitions), 165 - }; 166 - 167 - static struct resource nor_resource = { 168 - .start = OMAP_CS0_PHYS, 169 - .end = OMAP_CS0_PHYS + SZ_32M - 1, 170 - .flags = IORESOURCE_MEM, 171 - }; 172 - 173 - static struct platform_device nor_device = { 174 - .name = "physmap-flash", 175 - .id = 0, 176 - .dev = { 177 - .platform_data = &nor_data, 178 - }, 179 - .num_resources = 1, 180 - .resource = &nor_resource, 181 - }; 182 - 183 - #define FSAMPLE_NAND_RB_GPIO_PIN 62 184 - 185 - static int nand_dev_ready(struct nand_chip *chip) 186 - { 187 - return gpio_get_value(FSAMPLE_NAND_RB_GPIO_PIN); 188 - } 189 - 190 - static struct platform_nand_data nand_data = { 191 - .chip = { 192 - .nr_chips = 1, 193 - .chip_offset = 0, 194 - .options = NAND_SAMSUNG_LP_OPTIONS, 195 - }, 196 - .ctrl = { 197 - .cmd_ctrl = omap1_nand_cmd_ctl, 198 - .dev_ready = nand_dev_ready, 199 - }, 200 - }; 201 - 202 - static struct resource nand_resource = { 203 - .start = OMAP_CS3_PHYS, 204 - .end = OMAP_CS3_PHYS + SZ_4K - 1, 205 - .flags = IORESOURCE_MEM, 206 - }; 207 - 208 - static struct platform_device nand_device = { 209 - .name = "gen_nand", 210 - .id = 0, 211 - .dev = { 212 - .platform_data = &nand_data, 213 - }, 214 - .num_resources = 1, 215 - .resource = &nand_resource, 216 - }; 217 - 218 - static struct platform_device smc91x_device = { 219 - .name = "smc91x", 220 - .id = 0, 221 - .dev = { 222 - .platform_data = &smc91x_info, 223 - }, 224 - .num_resources = ARRAY_SIZE(smc91x_resources), 225 - .resource = smc91x_resources, 226 - }; 227 - 228 - static struct resource kp_resources[] = { 229 - [0] = { 230 - .start = INT_7XX_MPUIO_KEYPAD, 231 - .end = INT_7XX_MPUIO_KEYPAD, 232 - .flags = IORESOURCE_IRQ, 233 - }, 234 - }; 235 - 236 - static const struct matrix_keymap_data fsample_keymap_data = { 237 - .keymap = fsample_keymap, 238 - .keymap_size = ARRAY_SIZE(fsample_keymap), 239 - }; 240 - 241 - static struct omap_kp_platform_data kp_data = { 242 - .rows = 8, 243 - .cols = 8, 244 - .keymap_data = &fsample_keymap_data, 245 - .delay = 4, 246 - }; 247 - 248 - static struct platform_device kp_device = { 249 - .name = "omap-keypad", 250 - .id = -1, 251 - .dev = { 252 - .platform_data = &kp_data, 253 - }, 254 - .num_resources = ARRAY_SIZE(kp_resources), 255 - .resource = kp_resources, 256 - }; 257 - 258 - static struct platform_device *devices[] __initdata = { 259 - &nor_device, 260 - &nand_device, 261 - &smc91x_device, 262 - &kp_device, 263 - }; 264 - 265 - static const struct omap_lcd_config fsample_lcd_config = { 266 - .ctrl_name = "internal", 267 - }; 268 - 269 - static void __init omap_fsample_init(void) 270 - { 271 - /* Early, board-dependent init */ 272 - 273 - /* 274 - * Hold GSM Reset until needed 275 - */ 276 - omap_writew(omap_readw(OMAP7XX_DSP_M_CTL) & ~1, OMAP7XX_DSP_M_CTL); 277 - 278 - /* 279 - * UARTs -> done automagically by 8250 driver 280 - */ 281 - 282 - /* 283 - * CSx timings, GPIO Mux ... setup 284 - */ 285 - 286 - /* Flash: CS0 timings setup */ 287 - omap_writel(0x0000fff3, OMAP7XX_FLASH_CFG_0); 288 - omap_writel(0x00000088, OMAP7XX_FLASH_ACFG_0); 289 - 290 - /* 291 - * Ethernet support through the debug board 292 - * CS1 timings setup 293 - */ 294 - omap_writel(0x0000fff3, OMAP7XX_FLASH_CFG_1); 295 - omap_writel(0x00000000, OMAP7XX_FLASH_ACFG_1); 296 - 297 - /* 298 - * Configure MPU_EXT_NIRQ IO in IO_CONF9 register, 299 - * It is used as the Ethernet controller interrupt 300 - */ 301 - omap_writel(omap_readl(OMAP7XX_IO_CONF_9) & 0x1FFFFFFF, 302 - OMAP7XX_IO_CONF_9); 303 - 304 - fsample_init_smc91x(); 305 - 306 - BUG_ON(gpio_request(FSAMPLE_NAND_RB_GPIO_PIN, "NAND ready") < 0); 307 - gpio_direction_input(FSAMPLE_NAND_RB_GPIO_PIN); 308 - 309 - omap_cfg_reg(L3_1610_FLASH_CS2B_OE); 310 - omap_cfg_reg(M8_1610_FLASH_CS2B_WE); 311 - 312 - /* Mux pins for keypad */ 313 - omap_cfg_reg(E2_7XX_KBR0); 314 - omap_cfg_reg(J7_7XX_KBR1); 315 - omap_cfg_reg(E1_7XX_KBR2); 316 - omap_cfg_reg(F3_7XX_KBR3); 317 - omap_cfg_reg(D2_7XX_KBR4); 318 - omap_cfg_reg(C2_7XX_KBC0); 319 - omap_cfg_reg(D3_7XX_KBC1); 320 - omap_cfg_reg(E4_7XX_KBC2); 321 - omap_cfg_reg(F4_7XX_KBC3); 322 - omap_cfg_reg(E3_7XX_KBC4); 323 - 324 - platform_add_devices(devices, ARRAY_SIZE(devices)); 325 - 326 - omap_serial_init(); 327 - omap_register_i2c_bus(1, 100, NULL, 0); 328 - 329 - omapfb_set_lcd_config(&fsample_lcd_config); 330 - } 331 - 332 - /* Only FPGA needs to be mapped here. All others are done with ioremap */ 333 - static struct map_desc omap_fsample_io_desc[] __initdata = { 334 - { 335 - .virtual = H2P2_DBG_FPGA_BASE, 336 - .pfn = __phys_to_pfn(H2P2_DBG_FPGA_START), 337 - .length = H2P2_DBG_FPGA_SIZE, 338 - .type = MT_DEVICE 339 - }, 340 - { 341 - .virtual = FSAMPLE_CPLD_BASE, 342 - .pfn = __phys_to_pfn(FSAMPLE_CPLD_START), 343 - .length = FSAMPLE_CPLD_SIZE, 344 - .type = MT_DEVICE 345 - } 346 - }; 347 - 348 - static void __init omap_fsample_map_io(void) 349 - { 350 - omap15xx_map_io(); 351 - iotable_init(omap_fsample_io_desc, 352 - ARRAY_SIZE(omap_fsample_io_desc)); 353 - } 354 - 355 - MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-Sample") 356 - /* Maintainer: Brian Swetland <swetland@google.com> */ 357 - .atag_offset = 0x100, 358 - .map_io = omap_fsample_map_io, 359 - .init_early = omap1_init_early, 360 - .init_irq = omap1_init_irq, 361 - .handle_irq = omap1_handle_irq, 362 - .init_machine = omap_fsample_init, 363 - .init_late = omap1_init_late, 364 - .init_time = omap1_timer_init, 365 - .restart = omap1_restart, 366 - MACHINE_END
-85
arch/arm/mach-omap1/board-generic.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * linux/arch/arm/mach-omap1/board-generic.c 4 - * 5 - * Modified from board-innovator1510.c 6 - * 7 - * Code for generic OMAP board. Should work on many OMAP systems where 8 - * the device drivers take care of all the necessary hardware initialization. 9 - * Do not put any board specific code to this file; create a new machine 10 - * type if you need custom low-level initializations. 11 - */ 12 - #include <linux/gpio.h> 13 - #include <linux/kernel.h> 14 - #include <linux/init.h> 15 - #include <linux/platform_device.h> 16 - 17 - #include <asm/mach-types.h> 18 - #include <asm/mach/arch.h> 19 - #include <asm/mach/map.h> 20 - 21 - #include "hardware.h" 22 - #include "mux.h" 23 - #include "usb.h" 24 - #include "common.h" 25 - 26 - /* assume no Mini-AB port */ 27 - 28 - #ifdef CONFIG_ARCH_OMAP15XX 29 - static struct omap_usb_config generic1510_usb_config __initdata = { 30 - .register_host = 1, 31 - .register_dev = 1, 32 - .hmc_mode = 16, 33 - .pins[0] = 3, 34 - }; 35 - #endif 36 - 37 - #if defined(CONFIG_ARCH_OMAP16XX) 38 - static struct omap_usb_config generic1610_usb_config __initdata = { 39 - #ifdef CONFIG_USB_OTG 40 - .otg = 1, 41 - #endif 42 - .register_host = 1, 43 - .register_dev = 1, 44 - .hmc_mode = 16, 45 - .pins[0] = 6, 46 - }; 47 - #endif 48 - 49 - static void __init omap_generic_init(void) 50 - { 51 - #ifdef CONFIG_ARCH_OMAP15XX 52 - if (cpu_is_omap15xx()) { 53 - /* mux pins for uarts */ 54 - omap_cfg_reg(UART1_TX); 55 - omap_cfg_reg(UART1_RTS); 56 - omap_cfg_reg(UART2_TX); 57 - omap_cfg_reg(UART2_RTS); 58 - omap_cfg_reg(UART3_TX); 59 - omap_cfg_reg(UART3_RX); 60 - 61 - omap1_usb_init(&generic1510_usb_config); 62 - } 63 - #endif 64 - #if defined(CONFIG_ARCH_OMAP16XX) 65 - if (!cpu_is_omap1510()) { 66 - omap1_usb_init(&generic1610_usb_config); 67 - } 68 - #endif 69 - 70 - omap_serial_init(); 71 - omap_register_i2c_bus(1, 100, NULL, 0); 72 - } 73 - 74 - MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710") 75 - /* Maintainer: Tony Lindgren <tony@atomide.com> */ 76 - .atag_offset = 0x100, 77 - .map_io = omap16xx_map_io, 78 - .init_early = omap1_init_early, 79 - .init_irq = omap1_init_irq, 80 - .handle_irq = omap1_handle_irq, 81 - .init_machine = omap_generic_init, 82 - .init_late = omap1_init_late, 83 - .init_time = omap1_timer_init, 84 - .restart = omap1_restart, 85 - MACHINE_END
-74
arch/arm/mach-omap1/board-h2-mmc.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * linux/arch/arm/mach-omap1/board-h2-mmc.c 4 - * 5 - * Copyright (C) 2007 Instituto Nokia de Tecnologia - INdT 6 - * Author: Felipe Balbi <felipe.lima@indt.org.br> 7 - * 8 - * This code is based on linux/arch/arm/mach-omap2/board-n800-mmc.c, which is: 9 - * Copyright (C) 2006 Nokia Corporation 10 - */ 11 - #include <linux/gpio.h> 12 - #include <linux/platform_device.h> 13 - #include <linux/platform_data/gpio-omap.h> 14 - #include <linux/mfd/tps65010.h> 15 - 16 - #include "board-h2.h" 17 - #include "mmc.h" 18 - 19 - #if IS_ENABLED(CONFIG_MMC_OMAP) 20 - 21 - static int mmc_set_power(struct device *dev, int slot, int power_on, 22 - int vdd) 23 - { 24 - gpio_set_value(H2_TPS_GPIO_MMC_PWR_EN, power_on); 25 - return 0; 26 - } 27 - 28 - static int mmc_late_init(struct device *dev) 29 - { 30 - int ret = gpio_request(H2_TPS_GPIO_MMC_PWR_EN, "MMC power"); 31 - if (ret < 0) 32 - return ret; 33 - 34 - gpio_direction_output(H2_TPS_GPIO_MMC_PWR_EN, 0); 35 - 36 - return ret; 37 - } 38 - 39 - static void mmc_cleanup(struct device *dev) 40 - { 41 - gpio_free(H2_TPS_GPIO_MMC_PWR_EN); 42 - } 43 - 44 - /* 45 - * H2 could use the following functions tested: 46 - * - mmc_get_cover_state that uses OMAP_MPUIO(1) 47 - * - mmc_get_wp that uses OMAP_MPUIO(3) 48 - */ 49 - static struct omap_mmc_platform_data mmc1_data = { 50 - .nr_slots = 1, 51 - .init = mmc_late_init, 52 - .cleanup = mmc_cleanup, 53 - .slots[0] = { 54 - .set_power = mmc_set_power, 55 - .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, 56 - .name = "mmcblk", 57 - }, 58 - }; 59 - 60 - static struct omap_mmc_platform_data *mmc_data[OMAP16XX_NR_MMC]; 61 - 62 - void __init h2_mmc_init(void) 63 - { 64 - mmc_data[0] = &mmc1_data; 65 - omap1_init_mmc(mmc_data, OMAP16XX_NR_MMC); 66 - } 67 - 68 - #else 69 - 70 - void __init h2_mmc_init(void) 71 - { 72 - } 73 - 74 - #endif
-448
arch/arm/mach-omap1/board-h2.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * linux/arch/arm/mach-omap1/board-h2.c 4 - * 5 - * Board specific inits for OMAP-1610 H2 6 - * 7 - * Copyright (C) 2001 RidgeRun, Inc. 8 - * Author: Greg Lonnon <glonnon@ridgerun.com> 9 - * 10 - * Copyright (C) 2002 MontaVista Software, Inc. 11 - * 12 - * Separated FPGA interrupts from innovator1510.c and cleaned up for 2.6 13 - * Copyright (C) 2004 Nokia Corporation by Tony Lindrgen <tony@atomide.com> 14 - * 15 - * H2 specific changes and cleanup 16 - * Copyright (C) 2004 Nokia Corporation by Imre Deak <imre.deak@nokia.com> 17 - */ 18 - #include <linux/gpio.h> 19 - #include <linux/gpio/machine.h> 20 - #include <linux/kernel.h> 21 - #include <linux/platform_device.h> 22 - #include <linux/delay.h> 23 - #include <linux/i2c.h> 24 - #include <linux/mtd/mtd.h> 25 - #include <linux/mtd/platnand.h> 26 - #include <linux/mtd/physmap.h> 27 - #include <linux/input.h> 28 - #include <linux/mfd/tps65010.h> 29 - #include <linux/smc91x.h> 30 - #include <linux/omapfb.h> 31 - #include <linux/omap-dma.h> 32 - #include <linux/platform_data/gpio-omap.h> 33 - #include <linux/platform_data/keypad-omap.h> 34 - #include <linux/leds.h> 35 - 36 - #include <asm/mach-types.h> 37 - #include <asm/mach/arch.h> 38 - #include <asm/mach/map.h> 39 - 40 - #include "tc.h" 41 - #include "mux.h" 42 - #include "flash.h" 43 - #include "hardware.h" 44 - #include "usb.h" 45 - #include "common.h" 46 - #include "board-h2.h" 47 - 48 - /* The first 16 SoC GPIO lines are on this GPIO chip */ 49 - #define OMAP_GPIO_LABEL "gpio-0-15" 50 - 51 - /* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */ 52 - #define OMAP1610_ETHR_START 0x04000300 53 - 54 - static const unsigned int h2_keymap[] = { 55 - KEY(0, 0, KEY_LEFT), 56 - KEY(1, 0, KEY_RIGHT), 57 - KEY(2, 0, KEY_3), 58 - KEY(3, 0, KEY_F10), 59 - KEY(4, 0, KEY_F5), 60 - KEY(5, 0, KEY_9), 61 - KEY(0, 1, KEY_DOWN), 62 - KEY(1, 1, KEY_UP), 63 - KEY(2, 1, KEY_2), 64 - KEY(3, 1, KEY_F9), 65 - KEY(4, 1, KEY_F7), 66 - KEY(5, 1, KEY_0), 67 - KEY(0, 2, KEY_ENTER), 68 - KEY(1, 2, KEY_6), 69 - KEY(2, 2, KEY_1), 70 - KEY(3, 2, KEY_F2), 71 - KEY(4, 2, KEY_F6), 72 - KEY(5, 2, KEY_HOME), 73 - KEY(0, 3, KEY_8), 74 - KEY(1, 3, KEY_5), 75 - KEY(2, 3, KEY_F12), 76 - KEY(3, 3, KEY_F3), 77 - KEY(4, 3, KEY_F8), 78 - KEY(5, 3, KEY_END), 79 - KEY(0, 4, KEY_7), 80 - KEY(1, 4, KEY_4), 81 - KEY(2, 4, KEY_F11), 82 - KEY(3, 4, KEY_F1), 83 - KEY(4, 4, KEY_F4), 84 - KEY(5, 4, KEY_ESC), 85 - KEY(0, 5, KEY_F13), 86 - KEY(1, 5, KEY_F14), 87 - KEY(2, 5, KEY_F15), 88 - KEY(3, 5, KEY_F16), 89 - KEY(4, 5, KEY_SLEEP), 90 - }; 91 - 92 - static struct mtd_partition h2_nor_partitions[] = { 93 - /* bootloader (U-Boot, etc) in first sector */ 94 - { 95 - .name = "bootloader", 96 - .offset = 0, 97 - .size = SZ_128K, 98 - .mask_flags = MTD_WRITEABLE, /* force read-only */ 99 - }, 100 - /* bootloader params in the next sector */ 101 - { 102 - .name = "params", 103 - .offset = MTDPART_OFS_APPEND, 104 - .size = SZ_128K, 105 - .mask_flags = 0, 106 - }, 107 - /* kernel */ 108 - { 109 - .name = "kernel", 110 - .offset = MTDPART_OFS_APPEND, 111 - .size = SZ_2M, 112 - .mask_flags = 0 113 - }, 114 - /* file system */ 115 - { 116 - .name = "filesystem", 117 - .offset = MTDPART_OFS_APPEND, 118 - .size = MTDPART_SIZ_FULL, 119 - .mask_flags = 0 120 - } 121 - }; 122 - 123 - static struct physmap_flash_data h2_nor_data = { 124 - .width = 2, 125 - .set_vpp = omap1_set_vpp, 126 - .parts = h2_nor_partitions, 127 - .nr_parts = ARRAY_SIZE(h2_nor_partitions), 128 - }; 129 - 130 - static struct resource h2_nor_resource = { 131 - /* This is on CS3, wherever it's mapped */ 132 - .flags = IORESOURCE_MEM, 133 - }; 134 - 135 - static struct platform_device h2_nor_device = { 136 - .name = "physmap-flash", 137 - .id = 0, 138 - .dev = { 139 - .platform_data = &h2_nor_data, 140 - }, 141 - .num_resources = 1, 142 - .resource = &h2_nor_resource, 143 - }; 144 - 145 - static struct mtd_partition h2_nand_partitions[] = { 146 - #if 0 147 - /* REVISIT: enable these partitions if you make NAND BOOT 148 - * work on your H2 (rev C or newer); published versions of 149 - * x-load only support P2 and H3. 150 - */ 151 - { 152 - .name = "xloader", 153 - .offset = 0, 154 - .size = 64 * 1024, 155 - .mask_flags = MTD_WRITEABLE, /* force read-only */ 156 - }, 157 - { 158 - .name = "bootloader", 159 - .offset = MTDPART_OFS_APPEND, 160 - .size = 256 * 1024, 161 - .mask_flags = MTD_WRITEABLE, /* force read-only */ 162 - }, 163 - { 164 - .name = "params", 165 - .offset = MTDPART_OFS_APPEND, 166 - .size = 192 * 1024, 167 - }, 168 - { 169 - .name = "kernel", 170 - .offset = MTDPART_OFS_APPEND, 171 - .size = 2 * SZ_1M, 172 - }, 173 - #endif 174 - { 175 - .name = "filesystem", 176 - .size = MTDPART_SIZ_FULL, 177 - .offset = MTDPART_OFS_APPEND, 178 - }, 179 - }; 180 - 181 - #define H2_NAND_RB_GPIO_PIN 62 182 - 183 - static int h2_nand_dev_ready(struct nand_chip *chip) 184 - { 185 - return gpio_get_value(H2_NAND_RB_GPIO_PIN); 186 - } 187 - 188 - static struct platform_nand_data h2_nand_platdata = { 189 - .chip = { 190 - .nr_chips = 1, 191 - .chip_offset = 0, 192 - .nr_partitions = ARRAY_SIZE(h2_nand_partitions), 193 - .partitions = h2_nand_partitions, 194 - .options = NAND_SAMSUNG_LP_OPTIONS, 195 - }, 196 - .ctrl = { 197 - .cmd_ctrl = omap1_nand_cmd_ctl, 198 - .dev_ready = h2_nand_dev_ready, 199 - }, 200 - }; 201 - 202 - static struct resource h2_nand_resource = { 203 - .flags = IORESOURCE_MEM, 204 - }; 205 - 206 - static struct platform_device h2_nand_device = { 207 - .name = "gen_nand", 208 - .id = 0, 209 - .dev = { 210 - .platform_data = &h2_nand_platdata, 211 - }, 212 - .num_resources = 1, 213 - .resource = &h2_nand_resource, 214 - }; 215 - 216 - static struct smc91x_platdata h2_smc91x_info = { 217 - .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, 218 - .leda = RPC_LED_100_10, 219 - .ledb = RPC_LED_TX_RX, 220 - }; 221 - 222 - static struct resource h2_smc91x_resources[] = { 223 - [0] = { 224 - .start = OMAP1610_ETHR_START, /* Physical */ 225 - .end = OMAP1610_ETHR_START + 0xf, 226 - .flags = IORESOURCE_MEM, 227 - }, 228 - [1] = { 229 - .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE, 230 - }, 231 - }; 232 - 233 - static struct platform_device h2_smc91x_device = { 234 - .name = "smc91x", 235 - .id = 0, 236 - .dev = { 237 - .platform_data = &h2_smc91x_info, 238 - }, 239 - .num_resources = ARRAY_SIZE(h2_smc91x_resources), 240 - .resource = h2_smc91x_resources, 241 - }; 242 - 243 - static struct resource h2_kp_resources[] = { 244 - [0] = { 245 - .start = INT_KEYBOARD, 246 - .end = INT_KEYBOARD, 247 - .flags = IORESOURCE_IRQ, 248 - }, 249 - }; 250 - 251 - static const struct matrix_keymap_data h2_keymap_data = { 252 - .keymap = h2_keymap, 253 - .keymap_size = ARRAY_SIZE(h2_keymap), 254 - }; 255 - 256 - static struct omap_kp_platform_data h2_kp_data = { 257 - .rows = 8, 258 - .cols = 8, 259 - .keymap_data = &h2_keymap_data, 260 - .rep = true, 261 - .delay = 9, 262 - .dbounce = true, 263 - }; 264 - 265 - static struct platform_device h2_kp_device = { 266 - .name = "omap-keypad", 267 - .id = -1, 268 - .dev = { 269 - .platform_data = &h2_kp_data, 270 - }, 271 - .num_resources = ARRAY_SIZE(h2_kp_resources), 272 - .resource = h2_kp_resources, 273 - }; 274 - 275 - static const struct gpio_led h2_gpio_led_pins[] = { 276 - { 277 - .name = "h2:red", 278 - .default_trigger = "heartbeat", 279 - .gpio = 3, 280 - }, 281 - { 282 - .name = "h2:green", 283 - .default_trigger = "cpu0", 284 - .gpio = OMAP_MPUIO(4), 285 - }, 286 - }; 287 - 288 - static struct gpio_led_platform_data h2_gpio_led_data = { 289 - .leds = h2_gpio_led_pins, 290 - .num_leds = ARRAY_SIZE(h2_gpio_led_pins), 291 - }; 292 - 293 - static struct platform_device h2_gpio_leds = { 294 - .name = "leds-gpio", 295 - .id = -1, 296 - .dev = { 297 - .platform_data = &h2_gpio_led_data, 298 - }, 299 - }; 300 - 301 - static struct platform_device *h2_devices[] __initdata = { 302 - &h2_nor_device, 303 - &h2_nand_device, 304 - &h2_smc91x_device, 305 - &h2_kp_device, 306 - &h2_gpio_leds, 307 - }; 308 - 309 - static void __init h2_init_smc91x(void) 310 - { 311 - if (gpio_request(0, "SMC91x irq") < 0) { 312 - printk("Error requesting gpio 0 for smc91x irq\n"); 313 - return; 314 - } 315 - } 316 - 317 - static int tps_setup(struct i2c_client *client, void *context) 318 - { 319 - if (!IS_BUILTIN(CONFIG_TPS65010)) 320 - return -ENOSYS; 321 - 322 - tps65010_config_vregs1(TPS_LDO2_ENABLE | TPS_VLDO2_3_0V | 323 - TPS_LDO1_ENABLE | TPS_VLDO1_3_0V); 324 - 325 - return 0; 326 - } 327 - 328 - static struct tps65010_board tps_board = { 329 - .base = H2_TPS_GPIO_BASE, 330 - .outmask = 0x0f, 331 - .setup = tps_setup, 332 - }; 333 - 334 - static struct i2c_board_info __initdata h2_i2c_board_info[] = { 335 - { 336 - I2C_BOARD_INFO("tps65010", 0x48), 337 - .platform_data = &tps_board, 338 - }, { 339 - .type = "isp1301_omap", 340 - .addr = 0x2d, 341 - .dev_name = "isp1301", 342 - }, 343 - }; 344 - 345 - static struct gpiod_lookup_table isp1301_gpiod_table = { 346 - .dev_id = "isp1301", 347 - .table = { 348 - /* Active low since the irq triggers on falling edge */ 349 - GPIO_LOOKUP(OMAP_GPIO_LABEL, 2, 350 - NULL, GPIO_ACTIVE_LOW), 351 - { }, 352 - }, 353 - }; 354 - 355 - static struct omap_usb_config h2_usb_config __initdata = { 356 - /* usb1 has a Mini-AB port and external isp1301 transceiver */ 357 - .otg = 2, 358 - 359 - #if IS_ENABLED(CONFIG_USB_OMAP) 360 - .hmc_mode = 19, /* 0:host(off) 1:dev|otg 2:disabled */ 361 - /* .hmc_mode = 21,*/ /* 0:host(off) 1:dev(loopback) 2:host(loopback) */ 362 - #elif IS_ENABLED(CONFIG_USB_OHCI_HCD) 363 - /* needs OTG cable, or NONSTANDARD (B-to-MiniB) */ 364 - .hmc_mode = 20, /* 1:dev|otg(off) 1:host 2:disabled */ 365 - #endif 366 - 367 - .pins[1] = 3, 368 - }; 369 - 370 - static const struct omap_lcd_config h2_lcd_config __initconst = { 371 - .ctrl_name = "internal", 372 - }; 373 - 374 - static void __init h2_init(void) 375 - { 376 - h2_init_smc91x(); 377 - 378 - /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped 379 - * to address 0 by a dip switch), NAND on CS2B. The NAND driver will 380 - * notice whether a NAND chip is enabled at probe time. 381 - * 382 - * FIXME revC boards (and H3) support NAND-boot, with a dip switch to 383 - * put NOR on CS2B and NAND (which on H2 may be 16bit) on CS3. Try 384 - * detecting that in code here, to avoid probing every possible flash 385 - * configuration... 386 - */ 387 - h2_nor_resource.end = h2_nor_resource.start = omap_cs3_phys(); 388 - h2_nor_resource.end += SZ_32M - 1; 389 - 390 - h2_nand_resource.end = h2_nand_resource.start = OMAP_CS2B_PHYS; 391 - h2_nand_resource.end += SZ_4K - 1; 392 - BUG_ON(gpio_request(H2_NAND_RB_GPIO_PIN, "NAND ready") < 0); 393 - gpio_direction_input(H2_NAND_RB_GPIO_PIN); 394 - 395 - gpiod_add_lookup_table(&isp1301_gpiod_table); 396 - 397 - omap_cfg_reg(L3_1610_FLASH_CS2B_OE); 398 - omap_cfg_reg(M8_1610_FLASH_CS2B_WE); 399 - 400 - /* MMC: card detect and WP */ 401 - /* omap_cfg_reg(U19_ARMIO1); */ /* CD */ 402 - omap_cfg_reg(BALLOUT_V8_ARMIO3); /* WP */ 403 - 404 - /* Mux pins for keypad */ 405 - omap_cfg_reg(F18_1610_KBC0); 406 - omap_cfg_reg(D20_1610_KBC1); 407 - omap_cfg_reg(D19_1610_KBC2); 408 - omap_cfg_reg(E18_1610_KBC3); 409 - omap_cfg_reg(C21_1610_KBC4); 410 - omap_cfg_reg(G18_1610_KBR0); 411 - omap_cfg_reg(F19_1610_KBR1); 412 - omap_cfg_reg(H14_1610_KBR2); 413 - omap_cfg_reg(E20_1610_KBR3); 414 - omap_cfg_reg(E19_1610_KBR4); 415 - omap_cfg_reg(N19_1610_KBR5); 416 - 417 - /* GPIO based LEDs */ 418 - omap_cfg_reg(P18_1610_GPIO3); 419 - omap_cfg_reg(MPUIO4); 420 - 421 - h2_smc91x_resources[1].start = gpio_to_irq(0); 422 - h2_smc91x_resources[1].end = gpio_to_irq(0); 423 - platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices)); 424 - omap_serial_init(); 425 - 426 - /* ISP1301 IRQ wired at M14 */ 427 - omap_cfg_reg(M14_1510_GPIO2); 428 - h2_i2c_board_info[0].irq = gpio_to_irq(58); 429 - omap_register_i2c_bus(1, 100, h2_i2c_board_info, 430 - ARRAY_SIZE(h2_i2c_board_info)); 431 - omap1_usb_init(&h2_usb_config); 432 - h2_mmc_init(); 433 - 434 - omapfb_set_lcd_config(&h2_lcd_config); 435 - } 436 - 437 - MACHINE_START(OMAP_H2, "TI-H2") 438 - /* Maintainer: Imre Deak <imre.deak@nokia.com> */ 439 - .atag_offset = 0x100, 440 - .map_io = omap16xx_map_io, 441 - .init_early = omap1_init_early, 442 - .init_irq = omap1_init_irq, 443 - .handle_irq = omap1_handle_irq, 444 - .init_machine = h2_init, 445 - .init_late = omap1_init_late, 446 - .init_time = omap1_timer_init, 447 - .restart = omap1_restart, 448 - MACHINE_END
-38
arch/arm/mach-omap1/board-h2.h
··· 1 - /* 2 - * arch/arm/mach-omap1/board-h2.h 3 - * 4 - * Hardware definitions for TI OMAP1610 H2 board. 5 - * 6 - * Cleanup for Linux-2.6 by Dirk Behme <dirk.behme@de.bosch.com> 7 - * 8 - * This program is free software; you can redistribute it and/or modify it 9 - * under the terms of the GNU General Public License as published by the 10 - * Free Software Foundation; either version 2 of the License, or (at your 11 - * option) any later version. 12 - * 13 - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED 14 - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 15 - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN 16 - * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 19 - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 20 - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 - * 24 - * You should have received a copy of the GNU General Public License along 25 - * with this program; if not, write to the Free Software Foundation, Inc., 26 - * 675 Mass Ave, Cambridge, MA 02139, USA. 27 - */ 28 - 29 - #ifndef __ASM_ARCH_OMAP_H2_H 30 - #define __ASM_ARCH_OMAP_H2_H 31 - 32 - #define H2_TPS_GPIO_BASE (OMAP_MAX_GPIO_LINES + 16 /* MPUIO */) 33 - # define H2_TPS_GPIO_MMC_PWR_EN (H2_TPS_GPIO_BASE + 3) 34 - 35 - extern void h2_mmc_init(void); 36 - 37 - #endif /* __ASM_ARCH_OMAP_H2_H */ 38 -
-64
arch/arm/mach-omap1/board-h3-mmc.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * linux/arch/arm/mach-omap1/board-h3-mmc.c 4 - * 5 - * Copyright (C) 2007 Instituto Nokia de Tecnologia - INdT 6 - * Author: Felipe Balbi <felipe.lima@indt.org.br> 7 - * 8 - * This code is based on linux/arch/arm/mach-omap2/board-n800-mmc.c, which is: 9 - * Copyright (C) 2006 Nokia Corporation 10 - */ 11 - #include <linux/gpio.h> 12 - #include <linux/platform_device.h> 13 - 14 - #include <linux/mfd/tps65010.h> 15 - 16 - #include "common.h" 17 - #include "board-h3.h" 18 - #include "mmc.h" 19 - 20 - #if IS_ENABLED(CONFIG_MMC_OMAP) 21 - 22 - static int mmc_set_power(struct device *dev, int slot, int power_on, 23 - int vdd) 24 - { 25 - gpio_set_value(H3_TPS_GPIO_MMC_PWR_EN, power_on); 26 - return 0; 27 - } 28 - 29 - /* 30 - * H3 could use the following functions tested: 31 - * - mmc_get_cover_state that uses OMAP_MPUIO(1) 32 - * - mmc_get_wp that maybe uses OMAP_MPUIO(3) 33 - */ 34 - static struct omap_mmc_platform_data mmc1_data = { 35 - .nr_slots = 1, 36 - .slots[0] = { 37 - .set_power = mmc_set_power, 38 - .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, 39 - .name = "mmcblk", 40 - }, 41 - }; 42 - 43 - static struct omap_mmc_platform_data *mmc_data[OMAP16XX_NR_MMC]; 44 - 45 - void __init h3_mmc_init(void) 46 - { 47 - int ret; 48 - 49 - ret = gpio_request(H3_TPS_GPIO_MMC_PWR_EN, "MMC power"); 50 - if (ret < 0) 51 - return; 52 - gpio_direction_output(H3_TPS_GPIO_MMC_PWR_EN, 0); 53 - 54 - mmc_data[0] = &mmc1_data; 55 - omap1_init_mmc(mmc_data, OMAP16XX_NR_MMC); 56 - } 57 - 58 - #else 59 - 60 - void __init h3_mmc_init(void) 61 - { 62 - } 63 - 64 - #endif
-455
arch/arm/mach-omap1/board-h3.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * linux/arch/arm/mach-omap1/board-h3.c 4 - * 5 - * This file contains OMAP1710 H3 specific code. 6 - * 7 - * Copyright (C) 2004 Texas Instruments, Inc. 8 - * Copyright (C) 2002 MontaVista Software, Inc. 9 - * Copyright (C) 2001 RidgeRun, Inc. 10 - * Author: RidgeRun, Inc. 11 - * Greg Lonnon (glonnon@ridgerun.com) or info@ridgerun.com 12 - */ 13 - #include <linux/gpio.h> 14 - #include <linux/types.h> 15 - #include <linux/init.h> 16 - #include <linux/major.h> 17 - #include <linux/kernel.h> 18 - #include <linux/platform_device.h> 19 - #include <linux/errno.h> 20 - #include <linux/workqueue.h> 21 - #include <linux/i2c.h> 22 - #include <linux/mtd/mtd.h> 23 - #include <linux/mtd/platnand.h> 24 - #include <linux/mtd/partitions.h> 25 - #include <linux/mtd/physmap.h> 26 - #include <linux/input.h> 27 - #include <linux/spi/spi.h> 28 - #include <linux/mfd/tps65010.h> 29 - #include <linux/smc91x.h> 30 - #include <linux/omapfb.h> 31 - #include <linux/platform_data/gpio-omap.h> 32 - #include <linux/platform_data/keypad-omap.h> 33 - #include <linux/omap-dma.h> 34 - #include <linux/leds.h> 35 - 36 - #include <asm/setup.h> 37 - #include <asm/page.h> 38 - #include <asm/mach-types.h> 39 - #include <asm/mach/arch.h> 40 - #include <asm/mach/map.h> 41 - 42 - #include "tc.h" 43 - #include "mux.h" 44 - #include "flash.h" 45 - #include "hardware.h" 46 - #include "irqs.h" 47 - #include "usb.h" 48 - #include "common.h" 49 - #include "board-h3.h" 50 - 51 - /* In OMAP1710 H3 the Ethernet is directly connected to CS1 */ 52 - #define OMAP1710_ETHR_START 0x04000300 53 - 54 - #define H3_TS_GPIO 48 55 - 56 - static const unsigned int h3_keymap[] = { 57 - KEY(0, 0, KEY_LEFT), 58 - KEY(1, 0, KEY_RIGHT), 59 - KEY(2, 0, KEY_3), 60 - KEY(3, 0, KEY_F10), 61 - KEY(4, 0, KEY_F5), 62 - KEY(5, 0, KEY_9), 63 - KEY(0, 1, KEY_DOWN), 64 - KEY(1, 1, KEY_UP), 65 - KEY(2, 1, KEY_2), 66 - KEY(3, 1, KEY_F9), 67 - KEY(4, 1, KEY_F7), 68 - KEY(5, 1, KEY_0), 69 - KEY(0, 2, KEY_ENTER), 70 - KEY(1, 2, KEY_6), 71 - KEY(2, 2, KEY_1), 72 - KEY(3, 2, KEY_F2), 73 - KEY(4, 2, KEY_F6), 74 - KEY(5, 2, KEY_HOME), 75 - KEY(0, 3, KEY_8), 76 - KEY(1, 3, KEY_5), 77 - KEY(2, 3, KEY_F12), 78 - KEY(3, 3, KEY_F3), 79 - KEY(4, 3, KEY_F8), 80 - KEY(5, 3, KEY_END), 81 - KEY(0, 4, KEY_7), 82 - KEY(1, 4, KEY_4), 83 - KEY(2, 4, KEY_F11), 84 - KEY(3, 4, KEY_F1), 85 - KEY(4, 4, KEY_F4), 86 - KEY(5, 4, KEY_ESC), 87 - KEY(0, 5, KEY_F13), 88 - KEY(1, 5, KEY_F14), 89 - KEY(2, 5, KEY_F15), 90 - KEY(3, 5, KEY_F16), 91 - KEY(4, 5, KEY_SLEEP), 92 - }; 93 - 94 - 95 - static struct mtd_partition nor_partitions[] = { 96 - /* bootloader (U-Boot, etc) in first sector */ 97 - { 98 - .name = "bootloader", 99 - .offset = 0, 100 - .size = SZ_128K, 101 - .mask_flags = MTD_WRITEABLE, /* force read-only */ 102 - }, 103 - /* bootloader params in the next sector */ 104 - { 105 - .name = "params", 106 - .offset = MTDPART_OFS_APPEND, 107 - .size = SZ_128K, 108 - .mask_flags = 0, 109 - }, 110 - /* kernel */ 111 - { 112 - .name = "kernel", 113 - .offset = MTDPART_OFS_APPEND, 114 - .size = SZ_2M, 115 - .mask_flags = 0 116 - }, 117 - /* file system */ 118 - { 119 - .name = "filesystem", 120 - .offset = MTDPART_OFS_APPEND, 121 - .size = MTDPART_SIZ_FULL, 122 - .mask_flags = 0 123 - } 124 - }; 125 - 126 - static struct physmap_flash_data nor_data = { 127 - .width = 2, 128 - .set_vpp = omap1_set_vpp, 129 - .parts = nor_partitions, 130 - .nr_parts = ARRAY_SIZE(nor_partitions), 131 - }; 132 - 133 - static struct resource nor_resource = { 134 - /* This is on CS3, wherever it's mapped */ 135 - .flags = IORESOURCE_MEM, 136 - }; 137 - 138 - static struct platform_device nor_device = { 139 - .name = "physmap-flash", 140 - .id = 0, 141 - .dev = { 142 - .platform_data = &nor_data, 143 - }, 144 - .num_resources = 1, 145 - .resource = &nor_resource, 146 - }; 147 - 148 - static struct mtd_partition nand_partitions[] = { 149 - #if 0 150 - /* REVISIT: enable these partitions if you make NAND BOOT work */ 151 - { 152 - .name = "xloader", 153 - .offset = 0, 154 - .size = 64 * 1024, 155 - .mask_flags = MTD_WRITEABLE, /* force read-only */ 156 - }, 157 - { 158 - .name = "bootloader", 159 - .offset = MTDPART_OFS_APPEND, 160 - .size = 256 * 1024, 161 - .mask_flags = MTD_WRITEABLE, /* force read-only */ 162 - }, 163 - { 164 - .name = "params", 165 - .offset = MTDPART_OFS_APPEND, 166 - .size = 192 * 1024, 167 - }, 168 - { 169 - .name = "kernel", 170 - .offset = MTDPART_OFS_APPEND, 171 - .size = 2 * SZ_1M, 172 - }, 173 - #endif 174 - { 175 - .name = "filesystem", 176 - .size = MTDPART_SIZ_FULL, 177 - .offset = MTDPART_OFS_APPEND, 178 - }, 179 - }; 180 - 181 - #define H3_NAND_RB_GPIO_PIN 10 182 - 183 - static int nand_dev_ready(struct nand_chip *chip) 184 - { 185 - return gpio_get_value(H3_NAND_RB_GPIO_PIN); 186 - } 187 - 188 - static struct platform_nand_data nand_platdata = { 189 - .chip = { 190 - .nr_chips = 1, 191 - .chip_offset = 0, 192 - .nr_partitions = ARRAY_SIZE(nand_partitions), 193 - .partitions = nand_partitions, 194 - .options = NAND_SAMSUNG_LP_OPTIONS, 195 - }, 196 - .ctrl = { 197 - .cmd_ctrl = omap1_nand_cmd_ctl, 198 - .dev_ready = nand_dev_ready, 199 - 200 - }, 201 - }; 202 - 203 - static struct resource nand_resource = { 204 - .flags = IORESOURCE_MEM, 205 - }; 206 - 207 - static struct platform_device nand_device = { 208 - .name = "gen_nand", 209 - .id = 0, 210 - .dev = { 211 - .platform_data = &nand_platdata, 212 - }, 213 - .num_resources = 1, 214 - .resource = &nand_resource, 215 - }; 216 - 217 - static struct smc91x_platdata smc91x_info = { 218 - .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, 219 - .leda = RPC_LED_100_10, 220 - .ledb = RPC_LED_TX_RX, 221 - }; 222 - 223 - static struct resource smc91x_resources[] = { 224 - [0] = { 225 - .start = OMAP1710_ETHR_START, /* Physical */ 226 - .end = OMAP1710_ETHR_START + 0xf, 227 - .flags = IORESOURCE_MEM, 228 - }, 229 - [1] = { 230 - .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE, 231 - }, 232 - }; 233 - 234 - static struct platform_device smc91x_device = { 235 - .name = "smc91x", 236 - .id = 0, 237 - .dev = { 238 - .platform_data = &smc91x_info, 239 - }, 240 - .num_resources = ARRAY_SIZE(smc91x_resources), 241 - .resource = smc91x_resources, 242 - }; 243 - 244 - static void __init h3_init_smc91x(void) 245 - { 246 - omap_cfg_reg(W15_1710_GPIO40); 247 - if (gpio_request(40, "SMC91x irq") < 0) { 248 - printk("Error requesting gpio 40 for smc91x irq\n"); 249 - return; 250 - } 251 - } 252 - 253 - #define GPTIMER_BASE 0xFFFB1400 254 - #define GPTIMER_REGS(x) (0xFFFB1400 + (x * 0x800)) 255 - #define GPTIMER_REGS_SIZE 0x46 256 - 257 - static struct resource intlat_resources[] = { 258 - [0] = { 259 - .start = GPTIMER_REGS(0), /* Physical */ 260 - .end = GPTIMER_REGS(0) + GPTIMER_REGS_SIZE, 261 - .flags = IORESOURCE_MEM, 262 - }, 263 - [1] = { 264 - .start = INT_1610_GPTIMER1, 265 - .end = INT_1610_GPTIMER1, 266 - .flags = IORESOURCE_IRQ, 267 - }, 268 - }; 269 - 270 - static struct platform_device intlat_device = { 271 - .name = "omap_intlat", 272 - .id = 0, 273 - .num_resources = ARRAY_SIZE(intlat_resources), 274 - .resource = intlat_resources, 275 - }; 276 - 277 - static struct resource h3_kp_resources[] = { 278 - [0] = { 279 - .start = INT_KEYBOARD, 280 - .end = INT_KEYBOARD, 281 - .flags = IORESOURCE_IRQ, 282 - }, 283 - }; 284 - 285 - static const struct matrix_keymap_data h3_keymap_data = { 286 - .keymap = h3_keymap, 287 - .keymap_size = ARRAY_SIZE(h3_keymap), 288 - }; 289 - 290 - static struct omap_kp_platform_data h3_kp_data = { 291 - .rows = 8, 292 - .cols = 8, 293 - .keymap_data = &h3_keymap_data, 294 - .rep = true, 295 - .delay = 9, 296 - .dbounce = true, 297 - }; 298 - 299 - static struct platform_device h3_kp_device = { 300 - .name = "omap-keypad", 301 - .id = -1, 302 - .dev = { 303 - .platform_data = &h3_kp_data, 304 - }, 305 - .num_resources = ARRAY_SIZE(h3_kp_resources), 306 - .resource = h3_kp_resources, 307 - }; 308 - 309 - static struct platform_device h3_lcd_device = { 310 - .name = "lcd_h3", 311 - .id = -1, 312 - }; 313 - 314 - static struct spi_board_info h3_spi_board_info[] __initdata = { 315 - [0] = { 316 - .modalias = "tsc2101", 317 - .bus_num = 2, 318 - .chip_select = 0, 319 - .max_speed_hz = 16000000, 320 - /* .platform_data = &tsc_platform_data, */ 321 - }, 322 - }; 323 - 324 - static const struct gpio_led h3_gpio_led_pins[] = { 325 - { 326 - .name = "h3:red", 327 - .default_trigger = "heartbeat", 328 - .gpio = 3, 329 - }, 330 - { 331 - .name = "h3:green", 332 - .default_trigger = "cpu0", 333 - .gpio = OMAP_MPUIO(4), 334 - }, 335 - }; 336 - 337 - static struct gpio_led_platform_data h3_gpio_led_data = { 338 - .leds = h3_gpio_led_pins, 339 - .num_leds = ARRAY_SIZE(h3_gpio_led_pins), 340 - }; 341 - 342 - static struct platform_device h3_gpio_leds = { 343 - .name = "leds-gpio", 344 - .id = -1, 345 - .dev = { 346 - .platform_data = &h3_gpio_led_data, 347 - }, 348 - }; 349 - 350 - static struct platform_device *devices[] __initdata = { 351 - &nor_device, 352 - &nand_device, 353 - &smc91x_device, 354 - &intlat_device, 355 - &h3_kp_device, 356 - &h3_lcd_device, 357 - &h3_gpio_leds, 358 - }; 359 - 360 - static struct omap_usb_config h3_usb_config __initdata = { 361 - /* usb1 has a Mini-AB port and external isp1301 transceiver */ 362 - .otg = 2, 363 - 364 - #if IS_ENABLED(CONFIG_USB_OMAP) 365 - .hmc_mode = 19, /* 0:host(off) 1:dev|otg 2:disabled */ 366 - #elif IS_ENABLED(CONFIG_USB_OHCI_HCD) 367 - /* NONSTANDARD CABLE NEEDED (B-to-Mini-B) */ 368 - .hmc_mode = 20, /* 1:dev|otg(off) 1:host 2:disabled */ 369 - #endif 370 - 371 - .pins[1] = 3, 372 - }; 373 - 374 - static const struct omap_lcd_config h3_lcd_config __initconst = { 375 - .ctrl_name = "internal", 376 - }; 377 - 378 - static struct i2c_board_info __initdata h3_i2c_board_info[] = { 379 - { 380 - I2C_BOARD_INFO("tps65013", 0x48), 381 - }, 382 - { 383 - I2C_BOARD_INFO("isp1301_omap", 0x2d), 384 - }, 385 - }; 386 - 387 - static void __init h3_init(void) 388 - { 389 - h3_init_smc91x(); 390 - 391 - /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped 392 - * to address 0 by a dip switch), NAND on CS2B. The NAND driver will 393 - * notice whether a NAND chip is enabled at probe time. 394 - * 395 - * H3 support NAND-boot, with a dip switch to put NOR on CS2B and NAND 396 - * (which on H2 may be 16bit) on CS3. Try detecting that in code here, 397 - * to avoid probing every possible flash configuration... 398 - */ 399 - nor_resource.end = nor_resource.start = omap_cs3_phys(); 400 - nor_resource.end += SZ_32M - 1; 401 - 402 - nand_resource.end = nand_resource.start = OMAP_CS2B_PHYS; 403 - nand_resource.end += SZ_4K - 1; 404 - BUG_ON(gpio_request(H3_NAND_RB_GPIO_PIN, "NAND ready") < 0); 405 - gpio_direction_input(H3_NAND_RB_GPIO_PIN); 406 - 407 - /* GPIO10 Func_MUX_CTRL reg bit 29:27, Configure V2 to mode1 as GPIO */ 408 - /* GPIO10 pullup/down register, Enable pullup on GPIO10 */ 409 - omap_cfg_reg(V2_1710_GPIO10); 410 - 411 - /* Mux pins for keypad */ 412 - omap_cfg_reg(F18_1610_KBC0); 413 - omap_cfg_reg(D20_1610_KBC1); 414 - omap_cfg_reg(D19_1610_KBC2); 415 - omap_cfg_reg(E18_1610_KBC3); 416 - omap_cfg_reg(C21_1610_KBC4); 417 - omap_cfg_reg(G18_1610_KBR0); 418 - omap_cfg_reg(F19_1610_KBR1); 419 - omap_cfg_reg(H14_1610_KBR2); 420 - omap_cfg_reg(E20_1610_KBR3); 421 - omap_cfg_reg(E19_1610_KBR4); 422 - omap_cfg_reg(N19_1610_KBR5); 423 - 424 - /* GPIO based LEDs */ 425 - omap_cfg_reg(P18_1610_GPIO3); 426 - omap_cfg_reg(MPUIO4); 427 - 428 - smc91x_resources[1].start = gpio_to_irq(40); 429 - smc91x_resources[1].end = gpio_to_irq(40); 430 - platform_add_devices(devices, ARRAY_SIZE(devices)); 431 - h3_spi_board_info[0].irq = gpio_to_irq(H3_TS_GPIO); 432 - spi_register_board_info(h3_spi_board_info, 433 - ARRAY_SIZE(h3_spi_board_info)); 434 - omap_serial_init(); 435 - h3_i2c_board_info[1].irq = gpio_to_irq(14); 436 - omap_register_i2c_bus(1, 100, h3_i2c_board_info, 437 - ARRAY_SIZE(h3_i2c_board_info)); 438 - omap1_usb_init(&h3_usb_config); 439 - h3_mmc_init(); 440 - 441 - omapfb_set_lcd_config(&h3_lcd_config); 442 - } 443 - 444 - MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board") 445 - /* Maintainer: Texas Instruments, Inc. */ 446 - .atag_offset = 0x100, 447 - .map_io = omap16xx_map_io, 448 - .init_early = omap1_init_early, 449 - .init_irq = omap1_init_irq, 450 - .handle_irq = omap1_handle_irq, 451 - .init_machine = h3_init, 452 - .init_late = omap1_init_late, 453 - .init_time = omap1_timer_init, 454 - .restart = omap1_restart, 455 - MACHINE_END
-35
arch/arm/mach-omap1/board-h3.h
··· 1 - /* 2 - * arch/arm/mach-omap1/board-h3.h 3 - * 4 - * Copyright (C) 2001 RidgeRun, Inc. 5 - * Copyright (C) 2004 Texas Instruments, Inc. 6 - * 7 - * This program is free software; you can redistribute it and/or modify it 8 - * under the terms of the GNU General Public License as published by the 9 - * Free Software Foundation; either version 2 of the License, or (at your 10 - * option) any later version. 11 - * 12 - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED 13 - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 14 - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN 15 - * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 16 - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 17 - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 18 - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 19 - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 20 - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 21 - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 - * 23 - * You should have received a copy of the GNU General Public License along 24 - * with this program; if not, write to the Free Software Foundation, Inc., 25 - * 675 Mass Ave, Cambridge, MA 02139, USA. 26 - */ 27 - #ifndef __ASM_ARCH_OMAP_H3_H 28 - #define __ASM_ARCH_OMAP_H3_H 29 - 30 - #define H3_TPS_GPIO_BASE (OMAP_MAX_GPIO_LINES + 16 /* MPUIO */) 31 - # define H3_TPS_GPIO_MMC_PWR_EN (H3_TPS_GPIO_BASE + 4) 32 - 33 - extern void h3_mmc_init(void); 34 - 35 - #endif /* __ASM_ARCH_OMAP_H3_H */
-585
arch/arm/mach-omap1/board-htcherald.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * HTC Herald board configuration 4 - * Copyright (C) 2009 Cory Maccarrone <darkstar6262@gmail.com> 5 - * Copyright (C) 2009 Wing Linux 6 - * 7 - * Based on the board-htcwizard.c file from the linwizard project: 8 - * Copyright (C) 2006 Unai Uribarri 9 - * Copyright (C) 2008 linwizard.sourceforge.net 10 - */ 11 - #include <linux/kernel.h> 12 - #include <linux/init.h> 13 - #include <linux/platform_device.h> 14 - #include <linux/input.h> 15 - #include <linux/delay.h> 16 - #include <linux/gpio.h> 17 - #include <linux/gpio_keys.h> 18 - #include <linux/i2c.h> 19 - #include <linux/platform_data/i2c-gpio.h> 20 - #include <linux/htcpld.h> 21 - #include <linux/leds.h> 22 - #include <linux/spi/spi.h> 23 - #include <linux/spi/ads7846.h> 24 - #include <linux/omapfb.h> 25 - #include <linux/platform_data/keypad-omap.h> 26 - #include <linux/soc/ti/omap1-io.h> 27 - 28 - #include <asm/mach-types.h> 29 - #include <asm/mach/arch.h> 30 - 31 - #include "hardware.h" 32 - #include "omap7xx.h" 33 - #include "mmc.h" 34 - #include "irqs.h" 35 - #include "usb.h" 36 - #include "common.h" 37 - 38 - /* LCD register definition */ 39 - #define OMAP_LCDC_CONTROL (0xfffec000 + 0x00) 40 - #define OMAP_LCDC_STATUS (0xfffec000 + 0x10) 41 - #define OMAP_DMA_LCD_CCR (0xfffee300 + 0xc2) 42 - #define OMAP_DMA_LCD_CTRL (0xfffee300 + 0xc4) 43 - #define OMAP_LCDC_CTRL_LCD_EN (1 << 0) 44 - #define OMAP_LCDC_STAT_DONE (1 << 0) 45 - 46 - /* GPIO definitions for the power button and keyboard slide switch */ 47 - #define HTCHERALD_GPIO_POWER 139 48 - #define HTCHERALD_GPIO_SLIDE 174 49 - #define HTCHERALD_GIRQ_BTNS 141 50 - 51 - /* GPIO definitions for the touchscreen */ 52 - #define HTCHERALD_GPIO_TS 76 53 - 54 - /* HTCPLD definitions */ 55 - 56 - /* 57 - * CPLD Logic 58 - * 59 - * Chip 3 - 0x03 60 - * 61 - * Function 7 6 5 4 3 2 1 0 62 - * ------------------------------------ 63 - * DPAD light x x x x x x x 1 64 - * SoundDev x x x x 1 x x x 65 - * Screen white 1 x x x x x x x 66 - * MMC power on x x x x x 1 x x 67 - * Happy times (n) 0 x x x x 1 x x 68 - * 69 - * Chip 4 - 0x04 70 - * 71 - * Function 7 6 5 4 3 2 1 0 72 - * ------------------------------------ 73 - * Keyboard light x x x x x x x 1 74 - * LCD Bright (4) x x x x x 1 1 x 75 - * LCD Bright (3) x x x x x 0 1 x 76 - * LCD Bright (2) x x x x x 1 0 x 77 - * LCD Bright (1) x x x x x 0 0 x 78 - * LCD Off x x x x 0 x x x 79 - * LCD image (fb) 1 x x x x x x x 80 - * LCD image (white) 0 x x x x x x x 81 - * Caps lock LED x x 1 x x x x x 82 - * 83 - * Chip 5 - 0x05 84 - * 85 - * Function 7 6 5 4 3 2 1 0 86 - * ------------------------------------ 87 - * Red (solid) x x x x x 1 x x 88 - * Red (flash) x x x x x x 1 x 89 - * Green (GSM flash) x x x x 1 x x x 90 - * Green (GSM solid) x x x 1 x x x x 91 - * Green (wifi flash) x x 1 x x x x x 92 - * Blue (bt flash) x 1 x x x x x x 93 - * DPAD Int Enable 1 x x x x x x 0 94 - * 95 - * (Combinations of the above can be made for different colors.) 96 - * The direction pad interrupt enable must be set each time the 97 - * interrupt is handled. 98 - * 99 - * Chip 6 - 0x06 100 - * 101 - * Function 7 6 5 4 3 2 1 0 102 - * ------------------------------------ 103 - * Vibrator x x x x 1 x x x 104 - * Alt LED x x x 1 x x x x 105 - * Screen white 1 x x x x x x x 106 - * Screen white x x 1 x x x x x 107 - * Screen white x 0 x x x x x x 108 - * Enable kbd dpad x x x x x x 0 x 109 - * Happy Times 0 1 0 x x x 0 x 110 - */ 111 - 112 - /* 113 - * HTCPLD GPIO lines start 16 after OMAP_MAX_GPIO_LINES to account 114 - * for the 16 MPUIO lines. 115 - */ 116 - #define HTCPLD_GPIO_START_OFFSET (OMAP_MAX_GPIO_LINES + 16) 117 - #define HTCPLD_IRQ(chip, offset) (OMAP_IRQ_END + 8 * (chip) + (offset)) 118 - #define HTCPLD_BASE(chip, offset) \ 119 - (HTCPLD_GPIO_START_OFFSET + 8 * (chip) + (offset)) 120 - 121 - #define HTCPLD_GPIO_LED_DPAD HTCPLD_BASE(0, 0) 122 - #define HTCPLD_GPIO_LED_KBD HTCPLD_BASE(1, 0) 123 - #define HTCPLD_GPIO_LED_CAPS HTCPLD_BASE(1, 5) 124 - #define HTCPLD_GPIO_LED_RED_FLASH HTCPLD_BASE(2, 1) 125 - #define HTCPLD_GPIO_LED_RED_SOLID HTCPLD_BASE(2, 2) 126 - #define HTCPLD_GPIO_LED_GREEN_FLASH HTCPLD_BASE(2, 3) 127 - #define HTCPLD_GPIO_LED_GREEN_SOLID HTCPLD_BASE(2, 4) 128 - #define HTCPLD_GPIO_LED_WIFI HTCPLD_BASE(2, 5) 129 - #define HTCPLD_GPIO_LED_BT HTCPLD_BASE(2, 6) 130 - #define HTCPLD_GPIO_LED_VIBRATE HTCPLD_BASE(3, 3) 131 - #define HTCPLD_GPIO_LED_ALT HTCPLD_BASE(3, 4) 132 - 133 - #define HTCPLD_GPIO_RIGHT_KBD HTCPLD_BASE(6, 7) 134 - #define HTCPLD_GPIO_UP_KBD HTCPLD_BASE(6, 6) 135 - #define HTCPLD_GPIO_LEFT_KBD HTCPLD_BASE(6, 5) 136 - #define HTCPLD_GPIO_DOWN_KBD HTCPLD_BASE(6, 4) 137 - 138 - #define HTCPLD_GPIO_RIGHT_DPAD HTCPLD_BASE(7, 7) 139 - #define HTCPLD_GPIO_UP_DPAD HTCPLD_BASE(7, 6) 140 - #define HTCPLD_GPIO_LEFT_DPAD HTCPLD_BASE(7, 5) 141 - #define HTCPLD_GPIO_DOWN_DPAD HTCPLD_BASE(7, 4) 142 - #define HTCPLD_GPIO_ENTER_DPAD HTCPLD_BASE(7, 3) 143 - 144 - /* Chip 5 */ 145 - #define HTCPLD_IRQ_RIGHT_KBD HTCPLD_IRQ(0, 7) 146 - #define HTCPLD_IRQ_UP_KBD HTCPLD_IRQ(0, 6) 147 - #define HTCPLD_IRQ_LEFT_KBD HTCPLD_IRQ(0, 5) 148 - #define HTCPLD_IRQ_DOWN_KBD HTCPLD_IRQ(0, 4) 149 - 150 - /* Chip 6 */ 151 - #define HTCPLD_IRQ_RIGHT_DPAD HTCPLD_IRQ(1, 7) 152 - #define HTCPLD_IRQ_UP_DPAD HTCPLD_IRQ(1, 6) 153 - #define HTCPLD_IRQ_LEFT_DPAD HTCPLD_IRQ(1, 5) 154 - #define HTCPLD_IRQ_DOWN_DPAD HTCPLD_IRQ(1, 4) 155 - #define HTCPLD_IRQ_ENTER_DPAD HTCPLD_IRQ(1, 3) 156 - 157 - /* Keyboard definition */ 158 - 159 - static const unsigned int htc_herald_keymap[] = { 160 - KEY(0, 0, KEY_RECORD), /* Mail button */ 161 - KEY(1, 0, KEY_CAMERA), /* Camera */ 162 - KEY(2, 0, KEY_PHONE), /* Send key */ 163 - KEY(3, 0, KEY_VOLUMEUP), /* Volume up */ 164 - KEY(4, 0, KEY_F2), /* Right bar (landscape) */ 165 - KEY(5, 0, KEY_MAIL), /* Win key (portrait) */ 166 - KEY(6, 0, KEY_DIRECTORY), /* Right bar (portrait) */ 167 - KEY(0, 1, KEY_LEFTCTRL), /* Windows key */ 168 - KEY(1, 1, KEY_COMMA), 169 - KEY(2, 1, KEY_M), 170 - KEY(3, 1, KEY_K), 171 - KEY(4, 1, KEY_SLASH), /* OK key */ 172 - KEY(5, 1, KEY_I), 173 - KEY(6, 1, KEY_U), 174 - KEY(0, 2, KEY_LEFTALT), 175 - KEY(1, 2, KEY_TAB), 176 - KEY(2, 2, KEY_N), 177 - KEY(3, 2, KEY_J), 178 - KEY(4, 2, KEY_ENTER), 179 - KEY(5, 2, KEY_H), 180 - KEY(6, 2, KEY_Y), 181 - KEY(0, 3, KEY_SPACE), 182 - KEY(1, 3, KEY_L), 183 - KEY(2, 3, KEY_B), 184 - KEY(3, 3, KEY_V), 185 - KEY(4, 3, KEY_BACKSPACE), 186 - KEY(5, 3, KEY_G), 187 - KEY(6, 3, KEY_T), 188 - KEY(0, 4, KEY_CAPSLOCK), /* Shift */ 189 - KEY(1, 4, KEY_C), 190 - KEY(2, 4, KEY_F), 191 - KEY(3, 4, KEY_R), 192 - KEY(4, 4, KEY_O), 193 - KEY(5, 4, KEY_E), 194 - KEY(6, 4, KEY_D), 195 - KEY(0, 5, KEY_X), 196 - KEY(1, 5, KEY_Z), 197 - KEY(2, 5, KEY_S), 198 - KEY(3, 5, KEY_W), 199 - KEY(4, 5, KEY_P), 200 - KEY(5, 5, KEY_Q), 201 - KEY(6, 5, KEY_A), 202 - KEY(0, 6, KEY_CONNECT), /* Voice button */ 203 - KEY(2, 6, KEY_CANCEL), /* End key */ 204 - KEY(3, 6, KEY_VOLUMEDOWN), /* Volume down */ 205 - KEY(4, 6, KEY_F1), /* Left bar (landscape) */ 206 - KEY(5, 6, KEY_WWW), /* OK button (portrait) */ 207 - KEY(6, 6, KEY_CALENDAR), /* Left bar (portrait) */ 208 - }; 209 - 210 - static const struct matrix_keymap_data htc_herald_keymap_data = { 211 - .keymap = htc_herald_keymap, 212 - .keymap_size = ARRAY_SIZE(htc_herald_keymap), 213 - }; 214 - 215 - static struct omap_kp_platform_data htcherald_kp_data = { 216 - .rows = 7, 217 - .cols = 7, 218 - .delay = 20, 219 - .rep = true, 220 - .keymap_data = &htc_herald_keymap_data, 221 - }; 222 - 223 - static struct resource kp_resources[] = { 224 - [0] = { 225 - .start = INT_7XX_MPUIO_KEYPAD, 226 - .end = INT_7XX_MPUIO_KEYPAD, 227 - .flags = IORESOURCE_IRQ, 228 - }, 229 - }; 230 - 231 - static struct platform_device kp_device = { 232 - .name = "omap-keypad", 233 - .id = -1, 234 - .dev = { 235 - .platform_data = &htcherald_kp_data, 236 - }, 237 - .num_resources = ARRAY_SIZE(kp_resources), 238 - .resource = kp_resources, 239 - }; 240 - 241 - /* GPIO buttons for keyboard slide and power button */ 242 - static struct gpio_keys_button herald_gpio_keys_table[] = { 243 - {BTN_0, HTCHERALD_GPIO_POWER, 1, "POWER", EV_KEY, 1, 20}, 244 - {SW_LID, HTCHERALD_GPIO_SLIDE, 0, "SLIDE", EV_SW, 1, 20}, 245 - 246 - {KEY_LEFT, HTCPLD_GPIO_LEFT_KBD, 1, "LEFT", EV_KEY, 1, 20}, 247 - {KEY_RIGHT, HTCPLD_GPIO_RIGHT_KBD, 1, "RIGHT", EV_KEY, 1, 20}, 248 - {KEY_UP, HTCPLD_GPIO_UP_KBD, 1, "UP", EV_KEY, 1, 20}, 249 - {KEY_DOWN, HTCPLD_GPIO_DOWN_KBD, 1, "DOWN", EV_KEY, 1, 20}, 250 - 251 - {KEY_LEFT, HTCPLD_GPIO_LEFT_DPAD, 1, "DLEFT", EV_KEY, 1, 20}, 252 - {KEY_RIGHT, HTCPLD_GPIO_RIGHT_DPAD, 1, "DRIGHT", EV_KEY, 1, 20}, 253 - {KEY_UP, HTCPLD_GPIO_UP_DPAD, 1, "DUP", EV_KEY, 1, 20}, 254 - {KEY_DOWN, HTCPLD_GPIO_DOWN_DPAD, 1, "DDOWN", EV_KEY, 1, 20}, 255 - {KEY_ENTER, HTCPLD_GPIO_ENTER_DPAD, 1, "DENTER", EV_KEY, 1, 20}, 256 - }; 257 - 258 - static struct gpio_keys_platform_data herald_gpio_keys_data = { 259 - .buttons = herald_gpio_keys_table, 260 - .nbuttons = ARRAY_SIZE(herald_gpio_keys_table), 261 - .rep = true, 262 - }; 263 - 264 - static struct platform_device herald_gpiokeys_device = { 265 - .name = "gpio-keys", 266 - .id = -1, 267 - .dev = { 268 - .platform_data = &herald_gpio_keys_data, 269 - }, 270 - }; 271 - 272 - /* LEDs for the Herald. These connect to the HTCPLD GPIO device. */ 273 - static const struct gpio_led gpio_leds[] = { 274 - {"dpad", NULL, HTCPLD_GPIO_LED_DPAD, 0, 0, LEDS_GPIO_DEFSTATE_OFF}, 275 - {"kbd", NULL, HTCPLD_GPIO_LED_KBD, 0, 0, LEDS_GPIO_DEFSTATE_OFF}, 276 - {"vibrate", NULL, HTCPLD_GPIO_LED_VIBRATE, 0, 0, LEDS_GPIO_DEFSTATE_OFF}, 277 - {"green_solid", NULL, HTCPLD_GPIO_LED_GREEN_SOLID, 0, 0, LEDS_GPIO_DEFSTATE_OFF}, 278 - {"green_flash", NULL, HTCPLD_GPIO_LED_GREEN_FLASH, 0, 0, LEDS_GPIO_DEFSTATE_OFF}, 279 - {"red_solid", "mmc0", HTCPLD_GPIO_LED_RED_SOLID, 0, 0, LEDS_GPIO_DEFSTATE_OFF}, 280 - {"red_flash", NULL, HTCPLD_GPIO_LED_RED_FLASH, 0, 0, LEDS_GPIO_DEFSTATE_OFF}, 281 - {"wifi", NULL, HTCPLD_GPIO_LED_WIFI, 0, 0, LEDS_GPIO_DEFSTATE_OFF}, 282 - {"bt", NULL, HTCPLD_GPIO_LED_BT, 0, 0, LEDS_GPIO_DEFSTATE_OFF}, 283 - {"caps", NULL, HTCPLD_GPIO_LED_CAPS, 0, 0, LEDS_GPIO_DEFSTATE_OFF}, 284 - {"alt", NULL, HTCPLD_GPIO_LED_ALT, 0, 0, LEDS_GPIO_DEFSTATE_OFF}, 285 - }; 286 - 287 - static struct gpio_led_platform_data gpio_leds_data = { 288 - .leds = gpio_leds, 289 - .num_leds = ARRAY_SIZE(gpio_leds), 290 - }; 291 - 292 - static struct platform_device gpio_leds_device = { 293 - .name = "leds-gpio", 294 - .id = 0, 295 - .dev = { 296 - .platform_data = &gpio_leds_data, 297 - }, 298 - }; 299 - 300 - /* HTC PLD chips */ 301 - 302 - static struct resource htcpld_resources[] = { 303 - [0] = { 304 - .flags = IORESOURCE_IRQ, 305 - }, 306 - }; 307 - 308 - static struct htcpld_chip_platform_data htcpld_chips[] = { 309 - [0] = { 310 - .addr = 0x03, 311 - .reset = 0x04, 312 - .num_gpios = 8, 313 - .gpio_out_base = HTCPLD_BASE(0, 0), 314 - .gpio_in_base = HTCPLD_BASE(4, 0), 315 - }, 316 - [1] = { 317 - .addr = 0x04, 318 - .reset = 0x8e, 319 - .num_gpios = 8, 320 - .gpio_out_base = HTCPLD_BASE(1, 0), 321 - .gpio_in_base = HTCPLD_BASE(5, 0), 322 - }, 323 - [2] = { 324 - .addr = 0x05, 325 - .reset = 0x80, 326 - .num_gpios = 8, 327 - .gpio_out_base = HTCPLD_BASE(2, 0), 328 - .gpio_in_base = HTCPLD_BASE(6, 0), 329 - .irq_base = HTCPLD_IRQ(0, 0), 330 - .num_irqs = 8, 331 - }, 332 - [3] = { 333 - .addr = 0x06, 334 - .reset = 0x40, 335 - .num_gpios = 8, 336 - .gpio_out_base = HTCPLD_BASE(3, 0), 337 - .gpio_in_base = HTCPLD_BASE(7, 0), 338 - .irq_base = HTCPLD_IRQ(1, 0), 339 - .num_irqs = 8, 340 - }, 341 - }; 342 - 343 - static struct htcpld_core_platform_data htcpld_pfdata = { 344 - .i2c_adapter_id = 1, 345 - 346 - .chip = htcpld_chips, 347 - .num_chip = ARRAY_SIZE(htcpld_chips), 348 - }; 349 - 350 - static struct platform_device htcpld_device = { 351 - .name = "i2c-htcpld", 352 - .id = -1, 353 - .resource = htcpld_resources, 354 - .num_resources = ARRAY_SIZE(htcpld_resources), 355 - .dev = { 356 - .platform_data = &htcpld_pfdata, 357 - }, 358 - }; 359 - 360 - /* USB Device */ 361 - static struct omap_usb_config htcherald_usb_config __initdata = { 362 - .otg = 0, 363 - .register_host = 0, 364 - .register_dev = 1, 365 - .hmc_mode = 4, 366 - .pins[0] = 2, 367 - }; 368 - 369 - /* LCD Device resources */ 370 - static const struct omap_lcd_config htcherald_lcd_config __initconst = { 371 - .ctrl_name = "internal", 372 - }; 373 - 374 - static struct platform_device lcd_device = { 375 - .name = "lcd_htcherald", 376 - .id = -1, 377 - }; 378 - 379 - /* MMC Card */ 380 - #if IS_ENABLED(CONFIG_MMC_OMAP) 381 - static struct omap_mmc_platform_data htc_mmc1_data = { 382 - .nr_slots = 1, 383 - .switch_slot = NULL, 384 - .slots[0] = { 385 - .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, 386 - .name = "mmcblk", 387 - .nomux = 1, 388 - .wires = 4, 389 - .switch_pin = -1, 390 - }, 391 - }; 392 - 393 - static struct omap_mmc_platform_data *htc_mmc_data[1]; 394 - #endif 395 - 396 - 397 - /* Platform devices for the Herald */ 398 - static struct platform_device *devices[] __initdata = { 399 - &kp_device, 400 - &lcd_device, 401 - &htcpld_device, 402 - &gpio_leds_device, 403 - &herald_gpiokeys_device, 404 - }; 405 - 406 - /* 407 - * Touchscreen 408 - */ 409 - static const struct ads7846_platform_data htcherald_ts_platform_data = { 410 - .model = 7846, 411 - .keep_vref_on = 1, 412 - .x_plate_ohms = 496, 413 - .gpio_pendown = HTCHERALD_GPIO_TS, 414 - .pressure_max = 10000, 415 - .pressure_min = 5000, 416 - .x_min = 528, 417 - .x_max = 3760, 418 - .y_min = 624, 419 - .y_max = 3760, 420 - }; 421 - 422 - static struct spi_board_info __initdata htcherald_spi_board_info[] = { 423 - { 424 - .modalias = "ads7846", 425 - .platform_data = &htcherald_ts_platform_data, 426 - .max_speed_hz = 2500000, 427 - .bus_num = 2, 428 - .chip_select = 1, 429 - } 430 - }; 431 - 432 - /* 433 - * Init functions from here on 434 - */ 435 - 436 - static void __init htcherald_lcd_init(void) 437 - { 438 - u32 reg; 439 - unsigned int tries = 200; 440 - 441 - /* disable controller if active */ 442 - reg = omap_readl(OMAP_LCDC_CONTROL); 443 - if (reg & OMAP_LCDC_CTRL_LCD_EN) { 444 - reg &= ~OMAP_LCDC_CTRL_LCD_EN; 445 - omap_writel(reg, OMAP_LCDC_CONTROL); 446 - 447 - /* wait for end of frame */ 448 - while (!(omap_readl(OMAP_LCDC_STATUS) & OMAP_LCDC_STAT_DONE)) { 449 - tries--; 450 - if (!tries) 451 - break; 452 - } 453 - if (!tries) 454 - pr_err("Timeout waiting for end of frame -- LCD may not be available\n"); 455 - 456 - /* turn off DMA */ 457 - reg = omap_readw(OMAP_DMA_LCD_CCR); 458 - reg &= ~(1 << 7); 459 - omap_writew(reg, OMAP_DMA_LCD_CCR); 460 - 461 - reg = omap_readw(OMAP_DMA_LCD_CTRL); 462 - reg &= ~(1 << 8); 463 - omap_writew(reg, OMAP_DMA_LCD_CTRL); 464 - } 465 - } 466 - 467 - static void __init htcherald_map_io(void) 468 - { 469 - omap7xx_map_io(); 470 - 471 - /* 472 - * The LCD panel must be disabled and DMA turned off here, as doing 473 - * it later causes the LCD never to reinitialize. 474 - */ 475 - htcherald_lcd_init(); 476 - 477 - printk(KERN_INFO "htcherald_map_io done.\n"); 478 - } 479 - 480 - static void __init htcherald_disable_watchdog(void) 481 - { 482 - /* Disable watchdog if running */ 483 - if (omap_readl(OMAP_WDT_TIMER_MODE) & 0x8000) { 484 - /* 485 - * disable a potentially running watchdog timer before 486 - * it kills us. 487 - */ 488 - printk(KERN_WARNING "OMAP850 Watchdog seems to be activated, disabling it for now.\n"); 489 - omap_writel(0xF5, OMAP_WDT_TIMER_MODE); 490 - omap_writel(0xA0, OMAP_WDT_TIMER_MODE); 491 - } 492 - } 493 - 494 - #define HTCHERALD_GPIO_USB_EN1 33 495 - #define HTCHERALD_GPIO_USB_EN2 73 496 - #define HTCHERALD_GPIO_USB_DM 35 497 - #define HTCHERALD_GPIO_USB_DP 36 498 - 499 - static void __init htcherald_usb_enable(void) 500 - { 501 - unsigned int tries = 20; 502 - unsigned int value = 0; 503 - 504 - /* Request the GPIOs we need to control here */ 505 - if (gpio_request(HTCHERALD_GPIO_USB_EN1, "herald_usb") < 0) 506 - goto err1; 507 - 508 - if (gpio_request(HTCHERALD_GPIO_USB_EN2, "herald_usb") < 0) 509 - goto err2; 510 - 511 - if (gpio_request(HTCHERALD_GPIO_USB_DM, "herald_usb") < 0) 512 - goto err3; 513 - 514 - if (gpio_request(HTCHERALD_GPIO_USB_DP, "herald_usb") < 0) 515 - goto err4; 516 - 517 - /* force USB_EN GPIO to 0 */ 518 - do { 519 - /* output low */ 520 - gpio_direction_output(HTCHERALD_GPIO_USB_EN1, 0); 521 - } while ((value = gpio_get_value(HTCHERALD_GPIO_USB_EN1)) == 1 && 522 - --tries); 523 - 524 - if (value == 1) 525 - printk(KERN_WARNING "Unable to reset USB, trying to continue\n"); 526 - 527 - gpio_direction_output(HTCHERALD_GPIO_USB_EN2, 0); /* output low */ 528 - gpio_direction_input(HTCHERALD_GPIO_USB_DM); /* input */ 529 - gpio_direction_input(HTCHERALD_GPIO_USB_DP); /* input */ 530 - 531 - goto done; 532 - 533 - err4: 534 - gpio_free(HTCHERALD_GPIO_USB_DM); 535 - err3: 536 - gpio_free(HTCHERALD_GPIO_USB_EN2); 537 - err2: 538 - gpio_free(HTCHERALD_GPIO_USB_EN1); 539 - err1: 540 - printk(KERN_ERR "Unabled to request GPIO for USB\n"); 541 - done: 542 - printk(KERN_INFO "USB setup complete.\n"); 543 - } 544 - 545 - static void __init htcherald_init(void) 546 - { 547 - printk(KERN_INFO "HTC Herald init.\n"); 548 - 549 - /* Do board initialization before we register all the devices */ 550 - htcpld_resources[0].start = gpio_to_irq(HTCHERALD_GIRQ_BTNS); 551 - htcpld_resources[0].end = gpio_to_irq(HTCHERALD_GIRQ_BTNS); 552 - platform_add_devices(devices, ARRAY_SIZE(devices)); 553 - 554 - htcherald_disable_watchdog(); 555 - 556 - htcherald_usb_enable(); 557 - omap1_usb_init(&htcherald_usb_config); 558 - 559 - htcherald_spi_board_info[0].irq = gpio_to_irq(HTCHERALD_GPIO_TS); 560 - spi_register_board_info(htcherald_spi_board_info, 561 - ARRAY_SIZE(htcherald_spi_board_info)); 562 - 563 - omap_register_i2c_bus(1, 100, NULL, 0); 564 - 565 - #if IS_ENABLED(CONFIG_MMC_OMAP) 566 - htc_mmc_data[0] = &htc_mmc1_data; 567 - omap1_init_mmc(htc_mmc_data, 1); 568 - #endif 569 - 570 - omapfb_set_lcd_config(&htcherald_lcd_config); 571 - } 572 - 573 - MACHINE_START(HERALD, "HTC Herald") 574 - /* Maintainer: Cory Maccarrone <darkstar6262@gmail.com> */ 575 - /* Maintainer: wing-linux.sourceforge.net */ 576 - .atag_offset = 0x100, 577 - .map_io = htcherald_map_io, 578 - .init_early = omap1_init_early, 579 - .init_irq = omap1_init_irq, 580 - .handle_irq = omap1_handle_irq, 581 - .init_machine = htcherald_init, 582 - .init_late = omap1_init_late, 583 - .init_time = omap1_timer_init, 584 - .restart = omap1_restart, 585 - MACHINE_END
-481
arch/arm/mach-omap1/board-innovator.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * linux/arch/arm/mach-omap1/board-innovator.c 4 - * 5 - * Board specific inits for OMAP-1510 and OMAP-1610 Innovator 6 - * 7 - * Copyright (C) 2001 RidgeRun, Inc. 8 - * Author: Greg Lonnon <glonnon@ridgerun.com> 9 - * 10 - * Copyright (C) 2002 MontaVista Software, Inc. 11 - * 12 - * Separated FPGA interrupts from innovator1510.c and cleaned up for 2.6 13 - * Copyright (C) 2004 Nokia Corporation by Tony Lindrgen <tony@atomide.com> 14 - */ 15 - #include <linux/gpio.h> 16 - #include <linux/kernel.h> 17 - #include <linux/init.h> 18 - #include <linux/platform_device.h> 19 - #include <linux/delay.h> 20 - #include <linux/mtd/mtd.h> 21 - #include <linux/mtd/partitions.h> 22 - #include <linux/mtd/physmap.h> 23 - #include <linux/input.h> 24 - #include <linux/smc91x.h> 25 - #include <linux/omapfb.h> 26 - #include <linux/platform_data/keypad-omap.h> 27 - 28 - #include <asm/mach-types.h> 29 - #include <asm/mach/arch.h> 30 - #include <asm/mach/map.h> 31 - 32 - #include "tc.h" 33 - #include "mux.h" 34 - #include "flash.h" 35 - #include "hardware.h" 36 - #include "usb.h" 37 - #include "iomap.h" 38 - #include "common.h" 39 - #include "mmc.h" 40 - 41 - /* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */ 42 - #define INNOVATOR1610_ETHR_START 0x04000300 43 - 44 - static const unsigned int innovator_keymap[] = { 45 - KEY(0, 0, KEY_F1), 46 - KEY(3, 0, KEY_DOWN), 47 - KEY(1, 1, KEY_F2), 48 - KEY(2, 1, KEY_RIGHT), 49 - KEY(0, 2, KEY_F3), 50 - KEY(1, 2, KEY_F4), 51 - KEY(2, 2, KEY_UP), 52 - KEY(2, 3, KEY_ENTER), 53 - KEY(3, 3, KEY_LEFT), 54 - }; 55 - 56 - static struct mtd_partition innovator_partitions[] = { 57 - /* bootloader (U-Boot, etc) in first sector */ 58 - { 59 - .name = "bootloader", 60 - .offset = 0, 61 - .size = SZ_128K, 62 - .mask_flags = MTD_WRITEABLE, /* force read-only */ 63 - }, 64 - /* bootloader params in the next sector */ 65 - { 66 - .name = "params", 67 - .offset = MTDPART_OFS_APPEND, 68 - .size = SZ_128K, 69 - .mask_flags = 0, 70 - }, 71 - /* kernel */ 72 - { 73 - .name = "kernel", 74 - .offset = MTDPART_OFS_APPEND, 75 - .size = SZ_2M, 76 - .mask_flags = 0 77 - }, 78 - /* rest of flash1 is a file system */ 79 - { 80 - .name = "rootfs", 81 - .offset = MTDPART_OFS_APPEND, 82 - .size = SZ_16M - SZ_2M - 2 * SZ_128K, 83 - .mask_flags = 0 84 - }, 85 - /* file system */ 86 - { 87 - .name = "filesystem", 88 - .offset = MTDPART_OFS_APPEND, 89 - .size = MTDPART_SIZ_FULL, 90 - .mask_flags = 0 91 - } 92 - }; 93 - 94 - static struct physmap_flash_data innovator_flash_data = { 95 - .width = 2, 96 - .set_vpp = omap1_set_vpp, 97 - .parts = innovator_partitions, 98 - .nr_parts = ARRAY_SIZE(innovator_partitions), 99 - }; 100 - 101 - static struct resource innovator_flash_resource = { 102 - .start = OMAP_CS0_PHYS, 103 - .end = OMAP_CS0_PHYS + SZ_32M - 1, 104 - .flags = IORESOURCE_MEM, 105 - }; 106 - 107 - static struct platform_device innovator_flash_device = { 108 - .name = "physmap-flash", 109 - .id = 0, 110 - .dev = { 111 - .platform_data = &innovator_flash_data, 112 - }, 113 - .num_resources = 1, 114 - .resource = &innovator_flash_resource, 115 - }; 116 - 117 - static struct resource innovator_kp_resources[] = { 118 - [0] = { 119 - .start = INT_KEYBOARD, 120 - .end = INT_KEYBOARD, 121 - .flags = IORESOURCE_IRQ, 122 - }, 123 - }; 124 - 125 - static const struct matrix_keymap_data innovator_keymap_data = { 126 - .keymap = innovator_keymap, 127 - .keymap_size = ARRAY_SIZE(innovator_keymap), 128 - }; 129 - 130 - static struct omap_kp_platform_data innovator_kp_data = { 131 - .rows = 8, 132 - .cols = 8, 133 - .keymap_data = &innovator_keymap_data, 134 - .delay = 4, 135 - }; 136 - 137 - static struct platform_device innovator_kp_device = { 138 - .name = "omap-keypad", 139 - .id = -1, 140 - .dev = { 141 - .platform_data = &innovator_kp_data, 142 - }, 143 - .num_resources = ARRAY_SIZE(innovator_kp_resources), 144 - .resource = innovator_kp_resources, 145 - }; 146 - 147 - static struct smc91x_platdata innovator_smc91x_info = { 148 - .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, 149 - .leda = RPC_LED_100_10, 150 - .ledb = RPC_LED_TX_RX, 151 - }; 152 - 153 - #ifdef CONFIG_ARCH_OMAP15XX 154 - 155 - #include <linux/spi/spi.h> 156 - #include <linux/spi/ads7846.h> 157 - 158 - 159 - /* Only FPGA needs to be mapped here. All others are done with ioremap */ 160 - static struct map_desc innovator1510_io_desc[] __initdata = { 161 - { 162 - .virtual = OMAP1510_FPGA_BASE, 163 - .pfn = __phys_to_pfn(OMAP1510_FPGA_START), 164 - .length = OMAP1510_FPGA_SIZE, 165 - .type = MT_DEVICE 166 - } 167 - }; 168 - 169 - static struct resource innovator1510_smc91x_resources[] = { 170 - [0] = { 171 - .start = OMAP1510_FPGA_ETHR_START, /* Physical */ 172 - .end = OMAP1510_FPGA_ETHR_START + 0xf, 173 - .flags = IORESOURCE_MEM, 174 - }, 175 - [1] = { 176 - .start = OMAP1510_INT_ETHER, 177 - .end = OMAP1510_INT_ETHER, 178 - .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, 179 - }, 180 - }; 181 - 182 - static struct platform_device innovator1510_smc91x_device = { 183 - .name = "smc91x", 184 - .id = 0, 185 - .dev = { 186 - .platform_data = &innovator_smc91x_info, 187 - }, 188 - .num_resources = ARRAY_SIZE(innovator1510_smc91x_resources), 189 - .resource = innovator1510_smc91x_resources, 190 - }; 191 - 192 - static struct platform_device innovator1510_lcd_device = { 193 - .name = "lcd_inn1510", 194 - .id = -1, 195 - .dev = { 196 - .platform_data = (void __force *)OMAP1510_FPGA_LCD_PANEL_CONTROL, 197 - } 198 - }; 199 - 200 - static struct platform_device innovator1510_spi_device = { 201 - .name = "spi_inn1510", 202 - .id = -1, 203 - }; 204 - 205 - static struct platform_device *innovator1510_devices[] __initdata = { 206 - &innovator_flash_device, 207 - &innovator1510_smc91x_device, 208 - &innovator_kp_device, 209 - &innovator1510_lcd_device, 210 - &innovator1510_spi_device, 211 - }; 212 - 213 - static int innovator_get_pendown_state(void) 214 - { 215 - return !(__raw_readb(OMAP1510_FPGA_TOUCHSCREEN) & (1 << 5)); 216 - } 217 - 218 - static const struct ads7846_platform_data innovator1510_ts_info = { 219 - .model = 7846, 220 - .vref_delay_usecs = 100, /* internal, no capacitor */ 221 - .x_plate_ohms = 419, 222 - .y_plate_ohms = 486, 223 - .get_pendown_state = innovator_get_pendown_state, 224 - }; 225 - 226 - static struct spi_board_info __initdata innovator1510_boardinfo[] = { { 227 - /* FPGA (bus "10") CS0 has an ads7846e */ 228 - .modalias = "ads7846", 229 - .platform_data = &innovator1510_ts_info, 230 - .irq = OMAP1510_INT_FPGA_TS, 231 - .max_speed_hz = 120000 /* max sample rate at 3V */ 232 - * 26 /* command + data + overhead */, 233 - .bus_num = 10, 234 - .chip_select = 0, 235 - } }; 236 - 237 - #endif /* CONFIG_ARCH_OMAP15XX */ 238 - 239 - #ifdef CONFIG_ARCH_OMAP16XX 240 - 241 - static struct resource innovator1610_smc91x_resources[] = { 242 - [0] = { 243 - .start = INNOVATOR1610_ETHR_START, /* Physical */ 244 - .end = INNOVATOR1610_ETHR_START + 0xf, 245 - .flags = IORESOURCE_MEM, 246 - }, 247 - [1] = { 248 - .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE, 249 - }, 250 - }; 251 - 252 - static struct platform_device innovator1610_smc91x_device = { 253 - .name = "smc91x", 254 - .id = 0, 255 - .dev = { 256 - .platform_data = &innovator_smc91x_info, 257 - }, 258 - .num_resources = ARRAY_SIZE(innovator1610_smc91x_resources), 259 - .resource = innovator1610_smc91x_resources, 260 - }; 261 - 262 - static struct platform_device innovator1610_lcd_device = { 263 - .name = "inn1610_lcd", 264 - .id = -1, 265 - }; 266 - 267 - static struct platform_device *innovator1610_devices[] __initdata = { 268 - &innovator_flash_device, 269 - &innovator1610_smc91x_device, 270 - &innovator_kp_device, 271 - &innovator1610_lcd_device, 272 - }; 273 - 274 - #endif /* CONFIG_ARCH_OMAP16XX */ 275 - 276 - static void __init innovator_init_smc91x(void) 277 - { 278 - if (cpu_is_omap1510()) { 279 - __raw_writeb(__raw_readb(OMAP1510_FPGA_RST) & ~1, 280 - OMAP1510_FPGA_RST); 281 - udelay(750); 282 - } else { 283 - if (gpio_request(0, "SMC91x irq") < 0) { 284 - printk("Error requesting gpio 0 for smc91x irq\n"); 285 - return; 286 - } 287 - } 288 - } 289 - 290 - #ifdef CONFIG_ARCH_OMAP15XX 291 - /* 292 - * Board specific gang-switched transceiver power on/off. 293 - */ 294 - static int innovator_omap_ohci_transceiver_power(int on) 295 - { 296 - if (on) 297 - __raw_writeb(__raw_readb(INNOVATOR_FPGA_CAM_USB_CONTROL) 298 - | ((1 << 5/*usb1*/) | (1 << 3/*usb2*/)), 299 - INNOVATOR_FPGA_CAM_USB_CONTROL); 300 - else 301 - __raw_writeb(__raw_readb(INNOVATOR_FPGA_CAM_USB_CONTROL) 302 - & ~((1 << 5/*usb1*/) | (1 << 3/*usb2*/)), 303 - INNOVATOR_FPGA_CAM_USB_CONTROL); 304 - 305 - return 0; 306 - } 307 - 308 - static struct omap_usb_config innovator1510_usb_config __initdata = { 309 - /* for bundled non-standard host and peripheral cables */ 310 - .hmc_mode = 4, 311 - 312 - .register_host = 1, 313 - .pins[1] = 6, 314 - .pins[2] = 6, /* Conflicts with UART2 */ 315 - 316 - .register_dev = 1, 317 - .pins[0] = 2, 318 - 319 - .transceiver_power = innovator_omap_ohci_transceiver_power, 320 - }; 321 - 322 - static const struct omap_lcd_config innovator1510_lcd_config __initconst = { 323 - .ctrl_name = "internal", 324 - }; 325 - #endif 326 - 327 - #ifdef CONFIG_ARCH_OMAP16XX 328 - static struct omap_usb_config h2_usb_config __initdata = { 329 - /* usb1 has a Mini-AB port and external isp1301 transceiver */ 330 - .otg = 2, 331 - 332 - #if IS_ENABLED(CONFIG_USB_OMAP) 333 - .hmc_mode = 19, /* 0:host(off) 1:dev|otg 2:disabled */ 334 - /* .hmc_mode = 21,*/ /* 0:host(off) 1:dev(loopback) 2:host(loopback) */ 335 - #elif IS_ENABLED(CONFIG_USB_OHCI_HCD) 336 - /* NONSTANDARD CABLE NEEDED (B-to-Mini-B) */ 337 - .hmc_mode = 20, /* 1:dev|otg(off) 1:host 2:disabled */ 338 - #endif 339 - 340 - .pins[1] = 3, 341 - }; 342 - 343 - static const struct omap_lcd_config innovator1610_lcd_config __initconst = { 344 - .ctrl_name = "internal", 345 - }; 346 - #endif 347 - 348 - #if IS_ENABLED(CONFIG_MMC_OMAP) 349 - 350 - static int mmc_set_power(struct device *dev, int slot, int power_on, 351 - int vdd) 352 - { 353 - if (power_on) 354 - __raw_writeb(__raw_readb(OMAP1510_FPGA_POWER) | (1 << 3), 355 - OMAP1510_FPGA_POWER); 356 - else 357 - __raw_writeb(__raw_readb(OMAP1510_FPGA_POWER) & ~(1 << 3), 358 - OMAP1510_FPGA_POWER); 359 - 360 - return 0; 361 - } 362 - 363 - /* 364 - * Innovator could use the following functions tested: 365 - * - mmc_get_wp that uses OMAP_MPUIO(3) 366 - * - mmc_get_cover_state that uses FPGA F4 UIO43 367 - */ 368 - static struct omap_mmc_platform_data mmc1_data = { 369 - .nr_slots = 1, 370 - .slots[0] = { 371 - .set_power = mmc_set_power, 372 - .wires = 4, 373 - .name = "mmcblk", 374 - }, 375 - }; 376 - 377 - static struct omap_mmc_platform_data *mmc_data[OMAP16XX_NR_MMC]; 378 - 379 - static void __init innovator_mmc_init(void) 380 - { 381 - mmc_data[0] = &mmc1_data; 382 - omap1_init_mmc(mmc_data, OMAP15XX_NR_MMC); 383 - } 384 - 385 - #else 386 - static inline void innovator_mmc_init(void) 387 - { 388 - } 389 - #endif 390 - 391 - static void __init innovator_init(void) 392 - { 393 - if (cpu_is_omap1510()) 394 - omap1510_fpga_init_irq(); 395 - innovator_init_smc91x(); 396 - 397 - #ifdef CONFIG_ARCH_OMAP15XX 398 - if (cpu_is_omap1510()) { 399 - unsigned char reg; 400 - 401 - /* mux pins for uarts */ 402 - omap_cfg_reg(UART1_TX); 403 - omap_cfg_reg(UART1_RTS); 404 - omap_cfg_reg(UART2_TX); 405 - omap_cfg_reg(UART2_RTS); 406 - omap_cfg_reg(UART3_TX); 407 - omap_cfg_reg(UART3_RX); 408 - 409 - reg = __raw_readb(OMAP1510_FPGA_POWER); 410 - reg |= OMAP1510_FPGA_PCR_COM1_EN; 411 - __raw_writeb(reg, OMAP1510_FPGA_POWER); 412 - udelay(10); 413 - 414 - reg = __raw_readb(OMAP1510_FPGA_POWER); 415 - reg |= OMAP1510_FPGA_PCR_COM2_EN; 416 - __raw_writeb(reg, OMAP1510_FPGA_POWER); 417 - udelay(10); 418 - 419 - platform_add_devices(innovator1510_devices, ARRAY_SIZE(innovator1510_devices)); 420 - spi_register_board_info(innovator1510_boardinfo, 421 - ARRAY_SIZE(innovator1510_boardinfo)); 422 - } 423 - #endif 424 - #ifdef CONFIG_ARCH_OMAP16XX 425 - if (!cpu_is_omap1510()) { 426 - innovator1610_smc91x_resources[1].start = gpio_to_irq(0); 427 - innovator1610_smc91x_resources[1].end = gpio_to_irq(0); 428 - platform_add_devices(innovator1610_devices, ARRAY_SIZE(innovator1610_devices)); 429 - } 430 - #endif 431 - 432 - #ifdef CONFIG_ARCH_OMAP15XX 433 - if (cpu_is_omap1510()) { 434 - omap1_usb_init(&innovator1510_usb_config); 435 - omapfb_set_lcd_config(&innovator1510_lcd_config); 436 - } 437 - #endif 438 - #ifdef CONFIG_ARCH_OMAP16XX 439 - if (cpu_is_omap1610()) { 440 - omap1_usb_init(&h2_usb_config); 441 - omapfb_set_lcd_config(&innovator1610_lcd_config); 442 - } 443 - #endif 444 - omap_serial_init(); 445 - omap_register_i2c_bus(1, 100, NULL, 0); 446 - innovator_mmc_init(); 447 - } 448 - 449 - /* 450 - * REVISIT: Assume 15xx for now, we don't want to do revision check 451 - * until later on. The right way to fix this is to set up a different 452 - * machine_id for 16xx Innovator, or use device tree. 453 - */ 454 - static void __init innovator_map_io(void) 455 - { 456 - #ifdef CONFIG_ARCH_OMAP15XX 457 - omap15xx_map_io(); 458 - 459 - iotable_init(innovator1510_io_desc, ARRAY_SIZE(innovator1510_io_desc)); 460 - udelay(10); /* Delay needed for FPGA */ 461 - 462 - /* Dump the Innovator FPGA rev early - useful info for support. */ 463 - pr_debug("Innovator FPGA Rev %d.%d Board Rev %d\n", 464 - __raw_readb(OMAP1510_FPGA_REV_HIGH), 465 - __raw_readb(OMAP1510_FPGA_REV_LOW), 466 - __raw_readb(OMAP1510_FPGA_BOARD_REV)); 467 - #endif 468 - } 469 - 470 - MACHINE_START(OMAP_INNOVATOR, "TI-Innovator") 471 - /* Maintainer: MontaVista Software, Inc. */ 472 - .atag_offset = 0x100, 473 - .map_io = innovator_map_io, 474 - .init_early = omap1_init_early, 475 - .init_irq = omap1_init_irq, 476 - .handle_irq = omap1_handle_irq, 477 - .init_machine = innovator_init, 478 - .init_late = omap1_init_late, 479 - .init_time = omap1_timer_init, 480 - .restart = omap1_restart, 481 - MACHINE_END
-33
arch/arm/mach-omap1/board-nand.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * linux/arch/arm/mach-omap1/board-nand.c 4 - * 5 - * Common OMAP1 board NAND code 6 - * 7 - * Copyright (C) 2004, 2012 Texas Instruments, Inc. 8 - * Copyright (C) 2002 MontaVista Software, Inc. 9 - * Copyright (C) 2001 RidgeRun, Inc. 10 - * Author: RidgeRun, Inc. 11 - * Greg Lonnon (glonnon@ridgerun.com) or info@ridgerun.com 12 - */ 13 - #include <linux/kernel.h> 14 - #include <linux/io.h> 15 - #include <linux/mtd/mtd.h> 16 - #include <linux/mtd/rawnand.h> 17 - 18 - #include "common.h" 19 - 20 - void omap1_nand_cmd_ctl(struct nand_chip *this, int cmd, unsigned int ctrl) 21 - { 22 - unsigned long mask; 23 - 24 - if (cmd == NAND_CMD_NONE) 25 - return; 26 - 27 - mask = (ctrl & NAND_CLE) ? 0x02 : 0; 28 - if (ctrl & NAND_ALE) 29 - mask |= 0x04; 30 - 31 - writeb(cmd, this->legacy.IO_ADDR_W + mask); 32 - } 33 -
-285
arch/arm/mach-omap1/board-palmtt.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * linux/arch/arm/mach-omap1/board-palmtt.c 4 - * 5 - * Modified from board-palmtt2.c 6 - * 7 - * Modified and amended for Palm Tungsten|T 8 - * by Marek Vasut <marek.vasut@gmail.com> 9 - */ 10 - 11 - #include <linux/delay.h> 12 - #include <linux/gpio.h> 13 - #include <linux/kernel.h> 14 - #include <linux/init.h> 15 - #include <linux/platform_device.h> 16 - #include <linux/notifier.h> 17 - #include <linux/clk.h> 18 - #include <linux/input.h> 19 - #include <linux/interrupt.h> 20 - #include <linux/mtd/mtd.h> 21 - #include <linux/mtd/partitions.h> 22 - #include <linux/mtd/physmap.h> 23 - #include <linux/leds.h> 24 - #include <linux/omapfb.h> 25 - #include <linux/spi/spi.h> 26 - #include <linux/spi/ads7846.h> 27 - #include <linux/omap-dma.h> 28 - #include <linux/platform_data/omap1_bl.h> 29 - #include <linux/platform_data/leds-omap.h> 30 - #include <linux/platform_data/keypad-omap.h> 31 - 32 - #include <asm/mach-types.h> 33 - #include <asm/mach/arch.h> 34 - #include <asm/mach/map.h> 35 - 36 - #include "tc.h" 37 - #include "flash.h" 38 - #include "mux.h" 39 - #include "hardware.h" 40 - #include "usb.h" 41 - #include "common.h" 42 - 43 - #define PALMTT_USBDETECT_GPIO 0 44 - #define PALMTT_CABLE_GPIO 1 45 - #define PALMTT_LED_GPIO 3 46 - #define PALMTT_PENIRQ_GPIO 6 47 - #define PALMTT_MMC_WP_GPIO 8 48 - #define PALMTT_HDQ_GPIO 11 49 - 50 - static const unsigned int palmtt_keymap[] = { 51 - KEY(0, 0, KEY_ESC), 52 - KEY(1, 0, KEY_SPACE), 53 - KEY(2, 0, KEY_LEFTCTRL), 54 - KEY(3, 0, KEY_TAB), 55 - KEY(4, 0, KEY_ENTER), 56 - KEY(0, 1, KEY_LEFT), 57 - KEY(1, 1, KEY_DOWN), 58 - KEY(2, 1, KEY_UP), 59 - KEY(3, 1, KEY_RIGHT), 60 - KEY(0, 2, KEY_SLEEP), 61 - KEY(4, 2, KEY_Y), 62 - }; 63 - 64 - static struct mtd_partition palmtt_partitions[] = { 65 - { 66 - .name = "write8k", 67 - .offset = 0, 68 - .size = SZ_8K, 69 - .mask_flags = 0, 70 - }, 71 - { 72 - .name = "PalmOS-BootLoader(ro)", 73 - .offset = SZ_8K, 74 - .size = 7 * SZ_8K, 75 - .mask_flags = MTD_WRITEABLE, 76 - }, 77 - { 78 - .name = "u-boot", 79 - .offset = MTDPART_OFS_APPEND, 80 - .size = 8 * SZ_8K, 81 - .mask_flags = 0, 82 - }, 83 - { 84 - .name = "PalmOS-FS(ro)", 85 - .offset = MTDPART_OFS_APPEND, 86 - .size = 7 * SZ_1M + 4 * SZ_64K - 16 * SZ_8K, 87 - .mask_flags = MTD_WRITEABLE, 88 - }, 89 - { 90 - .name = "u-boot(rez)", 91 - .offset = MTDPART_OFS_APPEND, 92 - .size = SZ_128K, 93 - .mask_flags = 0 94 - }, 95 - { 96 - .name = "empty", 97 - .offset = MTDPART_OFS_APPEND, 98 - .size = MTDPART_SIZ_FULL, 99 - .mask_flags = 0 100 - } 101 - }; 102 - 103 - static struct physmap_flash_data palmtt_flash_data = { 104 - .width = 2, 105 - .set_vpp = omap1_set_vpp, 106 - .parts = palmtt_partitions, 107 - .nr_parts = ARRAY_SIZE(palmtt_partitions), 108 - }; 109 - 110 - static struct resource palmtt_flash_resource = { 111 - .start = OMAP_CS0_PHYS, 112 - .end = OMAP_CS0_PHYS + SZ_8M - 1, 113 - .flags = IORESOURCE_MEM, 114 - }; 115 - 116 - static struct platform_device palmtt_flash_device = { 117 - .name = "physmap-flash", 118 - .id = 0, 119 - .dev = { 120 - .platform_data = &palmtt_flash_data, 121 - }, 122 - .num_resources = 1, 123 - .resource = &palmtt_flash_resource, 124 - }; 125 - 126 - static struct resource palmtt_kp_resources[] = { 127 - [0] = { 128 - .start = INT_KEYBOARD, 129 - .end = INT_KEYBOARD, 130 - .flags = IORESOURCE_IRQ, 131 - }, 132 - }; 133 - 134 - static const struct matrix_keymap_data palmtt_keymap_data = { 135 - .keymap = palmtt_keymap, 136 - .keymap_size = ARRAY_SIZE(palmtt_keymap), 137 - }; 138 - 139 - static struct omap_kp_platform_data palmtt_kp_data = { 140 - .rows = 6, 141 - .cols = 3, 142 - .keymap_data = &palmtt_keymap_data, 143 - }; 144 - 145 - static struct platform_device palmtt_kp_device = { 146 - .name = "omap-keypad", 147 - .id = -1, 148 - .dev = { 149 - .platform_data = &palmtt_kp_data, 150 - }, 151 - .num_resources = ARRAY_SIZE(palmtt_kp_resources), 152 - .resource = palmtt_kp_resources, 153 - }; 154 - 155 - static struct platform_device palmtt_lcd_device = { 156 - .name = "lcd_palmtt", 157 - .id = -1, 158 - }; 159 - 160 - static struct platform_device palmtt_spi_device = { 161 - .name = "spi_palmtt", 162 - .id = -1, 163 - }; 164 - 165 - static struct omap_backlight_config palmtt_backlight_config = { 166 - .default_intensity = 0xa0, 167 - }; 168 - 169 - static struct platform_device palmtt_backlight_device = { 170 - .name = "omap-bl", 171 - .id = -1, 172 - .dev = { 173 - .platform_data= &palmtt_backlight_config, 174 - }, 175 - }; 176 - 177 - static struct omap_led_config palmtt_led_config[] = { 178 - { 179 - .cdev = { 180 - .name = "palmtt:led0", 181 - }, 182 - .gpio = PALMTT_LED_GPIO, 183 - }, 184 - }; 185 - 186 - static struct omap_led_platform_data palmtt_led_data = { 187 - .nr_leds = ARRAY_SIZE(palmtt_led_config), 188 - .leds = palmtt_led_config, 189 - }; 190 - 191 - static struct platform_device palmtt_led_device = { 192 - .name = "omap-led", 193 - .id = -1, 194 - .dev = { 195 - .platform_data = &palmtt_led_data, 196 - }, 197 - }; 198 - 199 - static struct platform_device *palmtt_devices[] __initdata = { 200 - &palmtt_flash_device, 201 - &palmtt_kp_device, 202 - &palmtt_lcd_device, 203 - &palmtt_spi_device, 204 - &palmtt_backlight_device, 205 - &palmtt_led_device, 206 - }; 207 - 208 - static int palmtt_get_pendown_state(void) 209 - { 210 - return !gpio_get_value(6); 211 - } 212 - 213 - static const struct ads7846_platform_data palmtt_ts_info = { 214 - .model = 7846, 215 - .vref_delay_usecs = 100, /* internal, no capacitor */ 216 - .x_plate_ohms = 419, 217 - .y_plate_ohms = 486, 218 - .get_pendown_state = palmtt_get_pendown_state, 219 - }; 220 - 221 - static struct spi_board_info __initdata palmtt_boardinfo[] = { 222 - { 223 - /* MicroWire (bus 2) CS0 has an ads7846e */ 224 - .modalias = "ads7846", 225 - .platform_data = &palmtt_ts_info, 226 - .max_speed_hz = 120000 /* max sample rate at 3V */ 227 - * 26 /* command + data + overhead */, 228 - .bus_num = 2, 229 - .chip_select = 0, 230 - } 231 - }; 232 - 233 - static struct omap_usb_config palmtt_usb_config __initdata = { 234 - .register_dev = 1, 235 - .hmc_mode = 0, 236 - .pins[0] = 2, 237 - }; 238 - 239 - static const struct omap_lcd_config palmtt_lcd_config __initconst = { 240 - .ctrl_name = "internal", 241 - }; 242 - 243 - static void __init omap_mpu_wdt_mode(int mode) { 244 - if (mode) 245 - omap_writew(0x8000, OMAP_WDT_TIMER_MODE); 246 - else { 247 - omap_writew(0x00f5, OMAP_WDT_TIMER_MODE); 248 - omap_writew(0x00a0, OMAP_WDT_TIMER_MODE); 249 - } 250 - } 251 - 252 - static void __init omap_palmtt_init(void) 253 - { 254 - /* mux pins for uarts */ 255 - omap_cfg_reg(UART1_TX); 256 - omap_cfg_reg(UART1_RTS); 257 - omap_cfg_reg(UART2_TX); 258 - omap_cfg_reg(UART2_RTS); 259 - omap_cfg_reg(UART3_TX); 260 - omap_cfg_reg(UART3_RX); 261 - 262 - omap_mpu_wdt_mode(0); 263 - 264 - platform_add_devices(palmtt_devices, ARRAY_SIZE(palmtt_devices)); 265 - 266 - palmtt_boardinfo[0].irq = gpio_to_irq(6); 267 - spi_register_board_info(palmtt_boardinfo,ARRAY_SIZE(palmtt_boardinfo)); 268 - omap_serial_init(); 269 - omap1_usb_init(&palmtt_usb_config); 270 - omap_register_i2c_bus(1, 100, NULL, 0); 271 - 272 - omapfb_set_lcd_config(&palmtt_lcd_config); 273 - } 274 - 275 - MACHINE_START(OMAP_PALMTT, "OMAP1510 based Palm Tungsten|T") 276 - .atag_offset = 0x100, 277 - .map_io = omap15xx_map_io, 278 - .init_early = omap1_init_early, 279 - .init_irq = omap1_init_irq, 280 - .handle_irq = omap1_handle_irq, 281 - .init_machine = omap_palmtt_init, 282 - .init_late = omap1_init_late, 283 - .init_time = omap1_timer_init, 284 - .restart = omap1_restart, 285 - MACHINE_END
-300
arch/arm/mach-omap1/board-palmz71.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * linux/arch/arm/mach-omap1/board-palmz71.c 4 - * 5 - * Modified from board-generic.c 6 - * 7 - * Support for the Palm Zire71 PDA. 8 - * 9 - * Original version : Laurent Gonzalez 10 - * 11 - * Modified for zire71 : Marek Vasut 12 - */ 13 - 14 - #include <linux/delay.h> 15 - #include <linux/gpio.h> 16 - #include <linux/kernel.h> 17 - #include <linux/init.h> 18 - #include <linux/platform_device.h> 19 - #include <linux/notifier.h> 20 - #include <linux/clk.h> 21 - #include <linux/irq.h> 22 - #include <linux/input.h> 23 - #include <linux/interrupt.h> 24 - #include <linux/mtd/mtd.h> 25 - #include <linux/mtd/partitions.h> 26 - #include <linux/mtd/physmap.h> 27 - #include <linux/omapfb.h> 28 - #include <linux/spi/spi.h> 29 - #include <linux/spi/ads7846.h> 30 - #include <linux/platform_data/omap1_bl.h> 31 - #include <linux/platform_data/keypad-omap.h> 32 - #include <linux/omap-dma.h> 33 - 34 - #include <asm/mach-types.h> 35 - #include <asm/mach/arch.h> 36 - #include <asm/mach/map.h> 37 - 38 - #include "tc.h" 39 - #include "flash.h" 40 - #include "mux.h" 41 - #include "hardware.h" 42 - #include "usb.h" 43 - #include "common.h" 44 - 45 - #define PALMZ71_USBDETECT_GPIO 0 46 - #define PALMZ71_PENIRQ_GPIO 6 47 - #define PALMZ71_MMC_WP_GPIO 8 48 - #define PALMZ71_HDQ_GPIO 11 49 - 50 - #define PALMZ71_HOTSYNC_GPIO OMAP_MPUIO(1) 51 - #define PALMZ71_CABLE_GPIO OMAP_MPUIO(2) 52 - #define PALMZ71_SLIDER_GPIO OMAP_MPUIO(3) 53 - #define PALMZ71_MMC_IN_GPIO OMAP_MPUIO(4) 54 - 55 - static const unsigned int palmz71_keymap[] = { 56 - KEY(0, 0, KEY_F1), 57 - KEY(1, 0, KEY_F2), 58 - KEY(2, 0, KEY_F3), 59 - KEY(3, 0, KEY_F4), 60 - KEY(4, 0, KEY_POWER), 61 - KEY(0, 1, KEY_LEFT), 62 - KEY(1, 1, KEY_DOWN), 63 - KEY(2, 1, KEY_UP), 64 - KEY(3, 1, KEY_RIGHT), 65 - KEY(4, 1, KEY_ENTER), 66 - KEY(0, 2, KEY_CAMERA), 67 - }; 68 - 69 - static const struct matrix_keymap_data palmz71_keymap_data = { 70 - .keymap = palmz71_keymap, 71 - .keymap_size = ARRAY_SIZE(palmz71_keymap), 72 - }; 73 - 74 - static struct omap_kp_platform_data palmz71_kp_data = { 75 - .rows = 8, 76 - .cols = 8, 77 - .keymap_data = &palmz71_keymap_data, 78 - .rep = true, 79 - .delay = 80, 80 - }; 81 - 82 - static struct resource palmz71_kp_resources[] = { 83 - [0] = { 84 - .start = INT_KEYBOARD, 85 - .end = INT_KEYBOARD, 86 - .flags = IORESOURCE_IRQ, 87 - }, 88 - }; 89 - 90 - static struct platform_device palmz71_kp_device = { 91 - .name = "omap-keypad", 92 - .id = -1, 93 - .dev = { 94 - .platform_data = &palmz71_kp_data, 95 - }, 96 - .num_resources = ARRAY_SIZE(palmz71_kp_resources), 97 - .resource = palmz71_kp_resources, 98 - }; 99 - 100 - static struct mtd_partition palmz71_rom_partitions[] = { 101 - /* PalmOS "Small ROM", contains the bootloader and the debugger */ 102 - { 103 - .name = "smallrom", 104 - .offset = 0, 105 - .size = 0xa000, 106 - .mask_flags = MTD_WRITEABLE, 107 - }, 108 - /* PalmOS "Big ROM", a filesystem with all the OS code and data */ 109 - { 110 - .name = "bigrom", 111 - .offset = SZ_128K, 112 - /* 113 - * 0x5f0000 bytes big in the multi-language ("EFIGS") version, 114 - * 0x7b0000 bytes in the English-only ("enUS") version. 115 - */ 116 - .size = 0x7b0000, 117 - .mask_flags = MTD_WRITEABLE, 118 - }, 119 - }; 120 - 121 - static struct physmap_flash_data palmz71_rom_data = { 122 - .width = 2, 123 - .set_vpp = omap1_set_vpp, 124 - .parts = palmz71_rom_partitions, 125 - .nr_parts = ARRAY_SIZE(palmz71_rom_partitions), 126 - }; 127 - 128 - static struct resource palmz71_rom_resource = { 129 - .start = OMAP_CS0_PHYS, 130 - .end = OMAP_CS0_PHYS + SZ_8M - 1, 131 - .flags = IORESOURCE_MEM, 132 - }; 133 - 134 - static struct platform_device palmz71_rom_device = { 135 - .name = "physmap-flash", 136 - .id = -1, 137 - .dev = { 138 - .platform_data = &palmz71_rom_data, 139 - }, 140 - .num_resources = 1, 141 - .resource = &palmz71_rom_resource, 142 - }; 143 - 144 - static struct platform_device palmz71_lcd_device = { 145 - .name = "lcd_palmz71", 146 - .id = -1, 147 - }; 148 - 149 - static struct platform_device palmz71_spi_device = { 150 - .name = "spi_palmz71", 151 - .id = -1, 152 - }; 153 - 154 - static struct omap_backlight_config palmz71_backlight_config = { 155 - .default_intensity = 0xa0, 156 - }; 157 - 158 - static struct platform_device palmz71_backlight_device = { 159 - .name = "omap-bl", 160 - .id = -1, 161 - .dev = { 162 - .platform_data = &palmz71_backlight_config, 163 - }, 164 - }; 165 - 166 - static struct platform_device *devices[] __initdata = { 167 - &palmz71_rom_device, 168 - &palmz71_kp_device, 169 - &palmz71_lcd_device, 170 - &palmz71_spi_device, 171 - &palmz71_backlight_device, 172 - }; 173 - 174 - static int 175 - palmz71_get_pendown_state(void) 176 - { 177 - return !gpio_get_value(PALMZ71_PENIRQ_GPIO); 178 - } 179 - 180 - static const struct ads7846_platform_data palmz71_ts_info = { 181 - .model = 7846, 182 - .vref_delay_usecs = 100, /* internal, no capacitor */ 183 - .x_plate_ohms = 419, 184 - .y_plate_ohms = 486, 185 - .get_pendown_state = palmz71_get_pendown_state, 186 - }; 187 - 188 - static struct spi_board_info __initdata palmz71_boardinfo[] = { { 189 - /* MicroWire (bus 2) CS0 has an ads7846e */ 190 - .modalias = "ads7846", 191 - .platform_data = &palmz71_ts_info, 192 - .max_speed_hz = 120000 /* max sample rate at 3V */ 193 - * 26 /* command + data + overhead */, 194 - .bus_num = 2, 195 - .chip_select = 0, 196 - } }; 197 - 198 - static struct omap_usb_config palmz71_usb_config __initdata = { 199 - .register_dev = 1, /* Mini-B only receptacle */ 200 - .hmc_mode = 0, 201 - .pins[0] = 2, 202 - }; 203 - 204 - static const struct omap_lcd_config palmz71_lcd_config __initconst = { 205 - .ctrl_name = "internal", 206 - }; 207 - 208 - static irqreturn_t 209 - palmz71_powercable(int irq, void *dev_id) 210 - { 211 - if (gpio_get_value(PALMZ71_USBDETECT_GPIO)) { 212 - printk(KERN_INFO "PM: Power cable connected\n"); 213 - irq_set_irq_type(gpio_to_irq(PALMZ71_USBDETECT_GPIO), 214 - IRQ_TYPE_EDGE_FALLING); 215 - } else { 216 - printk(KERN_INFO "PM: Power cable disconnected\n"); 217 - irq_set_irq_type(gpio_to_irq(PALMZ71_USBDETECT_GPIO), 218 - IRQ_TYPE_EDGE_RISING); 219 - } 220 - return IRQ_HANDLED; 221 - } 222 - 223 - static void __init 224 - omap_mpu_wdt_mode(int mode) 225 - { 226 - if (mode) 227 - omap_writew(0x8000, OMAP_WDT_TIMER_MODE); 228 - else { 229 - omap_writew(0x00f5, OMAP_WDT_TIMER_MODE); 230 - omap_writew(0x00a0, OMAP_WDT_TIMER_MODE); 231 - } 232 - } 233 - 234 - static void __init 235 - palmz71_gpio_setup(int early) 236 - { 237 - if (early) { 238 - /* Only set GPIO1 so we have a working serial */ 239 - gpio_direction_output(1, 1); 240 - } else { 241 - /* Set MMC/SD host WP pin as input */ 242 - if (gpio_request(PALMZ71_MMC_WP_GPIO, "MMC WP") < 0) { 243 - printk(KERN_ERR "Could not reserve WP GPIO!\n"); 244 - return; 245 - } 246 - gpio_direction_input(PALMZ71_MMC_WP_GPIO); 247 - 248 - /* Monitor the Power-cable-connected signal */ 249 - if (gpio_request(PALMZ71_USBDETECT_GPIO, "USB detect") < 0) { 250 - printk(KERN_ERR 251 - "Could not reserve cable signal GPIO!\n"); 252 - return; 253 - } 254 - gpio_direction_input(PALMZ71_USBDETECT_GPIO); 255 - if (request_irq(gpio_to_irq(PALMZ71_USBDETECT_GPIO), 256 - palmz71_powercable, 0, "palmz71-cable", NULL)) 257 - printk(KERN_ERR 258 - "IRQ request for power cable failed!\n"); 259 - palmz71_powercable(gpio_to_irq(PALMZ71_USBDETECT_GPIO), NULL); 260 - } 261 - } 262 - 263 - static void __init 264 - omap_palmz71_init(void) 265 - { 266 - /* mux pins for uarts */ 267 - omap_cfg_reg(UART1_TX); 268 - omap_cfg_reg(UART1_RTS); 269 - omap_cfg_reg(UART2_TX); 270 - omap_cfg_reg(UART2_RTS); 271 - omap_cfg_reg(UART3_TX); 272 - omap_cfg_reg(UART3_RX); 273 - 274 - palmz71_gpio_setup(1); 275 - omap_mpu_wdt_mode(0); 276 - 277 - platform_add_devices(devices, ARRAY_SIZE(devices)); 278 - 279 - palmz71_boardinfo[0].irq = gpio_to_irq(PALMZ71_PENIRQ_GPIO); 280 - spi_register_board_info(palmz71_boardinfo, 281 - ARRAY_SIZE(palmz71_boardinfo)); 282 - omap1_usb_init(&palmz71_usb_config); 283 - omap_serial_init(); 284 - omap_register_i2c_bus(1, 100, NULL, 0); 285 - palmz71_gpio_setup(0); 286 - 287 - omapfb_set_lcd_config(&palmz71_lcd_config); 288 - } 289 - 290 - MACHINE_START(OMAP_PALMZ71, "OMAP310 based Palm Zire71") 291 - .atag_offset = 0x100, 292 - .map_io = omap15xx_map_io, 293 - .init_early = omap1_init_early, 294 - .init_irq = omap1_init_irq, 295 - .handle_irq = omap1_handle_irq, 296 - .init_machine = omap_palmz71_init, 297 - .init_late = omap1_init_late, 298 - .init_time = omap1_timer_init, 299 - .restart = omap1_restart, 300 - MACHINE_END
-333
arch/arm/mach-omap1/board-perseus2.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * linux/arch/arm/mach-omap1/board-perseus2.c 4 - * 5 - * Modified from board-generic.c 6 - * 7 - * Original OMAP730 support by Jean Pihet <j-pihet@ti.com> 8 - * Updated for 2.6 by Kevin Hilman <kjh@hilman.org> 9 - */ 10 - #include <linux/gpio.h> 11 - #include <linux/kernel.h> 12 - #include <linux/init.h> 13 - #include <linux/platform_device.h> 14 - #include <linux/delay.h> 15 - #include <linux/mtd/mtd.h> 16 - #include <linux/mtd/platnand.h> 17 - #include <linux/mtd/physmap.h> 18 - #include <linux/input.h> 19 - #include <linux/smc91x.h> 20 - #include <linux/omapfb.h> 21 - #include <linux/platform_data/keypad-omap.h> 22 - #include <linux/soc/ti/omap1-io.h> 23 - 24 - #include <asm/mach-types.h> 25 - #include <asm/mach/arch.h> 26 - #include <asm/mach/map.h> 27 - 28 - #include "tc.h" 29 - #include "mux.h" 30 - #include "flash.h" 31 - #include "hardware.h" 32 - #include "iomap.h" 33 - #include "common.h" 34 - #include "fpga.h" 35 - 36 - static const unsigned int p2_keymap[] = { 37 - KEY(0, 0, KEY_UP), 38 - KEY(1, 0, KEY_RIGHT), 39 - KEY(2, 0, KEY_LEFT), 40 - KEY(3, 0, KEY_DOWN), 41 - KEY(4, 0, KEY_ENTER), 42 - KEY(0, 1, KEY_F10), 43 - KEY(1, 1, KEY_SEND), 44 - KEY(2, 1, KEY_END), 45 - KEY(3, 1, KEY_VOLUMEDOWN), 46 - KEY(4, 1, KEY_VOLUMEUP), 47 - KEY(5, 1, KEY_RECORD), 48 - KEY(0, 2, KEY_F9), 49 - KEY(1, 2, KEY_3), 50 - KEY(2, 2, KEY_6), 51 - KEY(3, 2, KEY_9), 52 - KEY(4, 2, KEY_KPDOT), 53 - KEY(0, 3, KEY_BACK), 54 - KEY(1, 3, KEY_2), 55 - KEY(2, 3, KEY_5), 56 - KEY(3, 3, KEY_8), 57 - KEY(4, 3, KEY_0), 58 - KEY(5, 3, KEY_KPSLASH), 59 - KEY(0, 4, KEY_HOME), 60 - KEY(1, 4, KEY_1), 61 - KEY(2, 4, KEY_4), 62 - KEY(3, 4, KEY_7), 63 - KEY(4, 4, KEY_KPASTERISK), 64 - KEY(5, 4, KEY_POWER), 65 - }; 66 - 67 - static struct smc91x_platdata smc91x_info = { 68 - .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, 69 - .leda = RPC_LED_100_10, 70 - .ledb = RPC_LED_TX_RX, 71 - }; 72 - 73 - static struct resource smc91x_resources[] = { 74 - [0] = { 75 - .start = H2P2_DBG_FPGA_ETHR_START, /* Physical */ 76 - .end = H2P2_DBG_FPGA_ETHR_START + 0xf, 77 - .flags = IORESOURCE_MEM, 78 - }, 79 - [1] = { 80 - .start = INT_7XX_MPU_EXT_NIRQ, 81 - .end = 0, 82 - .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, 83 - }, 84 - }; 85 - 86 - static struct mtd_partition nor_partitions[] = { 87 - /* bootloader (U-Boot, etc) in first sector */ 88 - { 89 - .name = "bootloader", 90 - .offset = 0, 91 - .size = SZ_128K, 92 - .mask_flags = MTD_WRITEABLE, /* force read-only */ 93 - }, 94 - /* bootloader params in the next sector */ 95 - { 96 - .name = "params", 97 - .offset = MTDPART_OFS_APPEND, 98 - .size = SZ_128K, 99 - .mask_flags = 0, 100 - }, 101 - /* kernel */ 102 - { 103 - .name = "kernel", 104 - .offset = MTDPART_OFS_APPEND, 105 - .size = SZ_2M, 106 - .mask_flags = 0 107 - }, 108 - /* rest of flash is a file system */ 109 - { 110 - .name = "rootfs", 111 - .offset = MTDPART_OFS_APPEND, 112 - .size = MTDPART_SIZ_FULL, 113 - .mask_flags = 0 114 - }, 115 - }; 116 - 117 - static struct physmap_flash_data nor_data = { 118 - .width = 2, 119 - .set_vpp = omap1_set_vpp, 120 - .parts = nor_partitions, 121 - .nr_parts = ARRAY_SIZE(nor_partitions), 122 - }; 123 - 124 - static struct resource nor_resource = { 125 - .start = OMAP_CS0_PHYS, 126 - .end = OMAP_CS0_PHYS + SZ_32M - 1, 127 - .flags = IORESOURCE_MEM, 128 - }; 129 - 130 - static struct platform_device nor_device = { 131 - .name = "physmap-flash", 132 - .id = 0, 133 - .dev = { 134 - .platform_data = &nor_data, 135 - }, 136 - .num_resources = 1, 137 - .resource = &nor_resource, 138 - }; 139 - 140 - #define P2_NAND_RB_GPIO_PIN 62 141 - 142 - static int nand_dev_ready(struct nand_chip *chip) 143 - { 144 - return gpio_get_value(P2_NAND_RB_GPIO_PIN); 145 - } 146 - 147 - static struct platform_nand_data nand_data = { 148 - .chip = { 149 - .nr_chips = 1, 150 - .chip_offset = 0, 151 - .options = NAND_SAMSUNG_LP_OPTIONS, 152 - }, 153 - .ctrl = { 154 - .cmd_ctrl = omap1_nand_cmd_ctl, 155 - .dev_ready = nand_dev_ready, 156 - }, 157 - }; 158 - 159 - static struct resource nand_resource = { 160 - .start = OMAP_CS3_PHYS, 161 - .end = OMAP_CS3_PHYS + SZ_4K - 1, 162 - .flags = IORESOURCE_MEM, 163 - }; 164 - 165 - static struct platform_device nand_device = { 166 - .name = "gen_nand", 167 - .id = 0, 168 - .dev = { 169 - .platform_data = &nand_data, 170 - }, 171 - .num_resources = 1, 172 - .resource = &nand_resource, 173 - }; 174 - 175 - static struct platform_device smc91x_device = { 176 - .name = "smc91x", 177 - .id = 0, 178 - .dev = { 179 - .platform_data = &smc91x_info, 180 - }, 181 - .num_resources = ARRAY_SIZE(smc91x_resources), 182 - .resource = smc91x_resources, 183 - }; 184 - 185 - static struct resource kp_resources[] = { 186 - [0] = { 187 - .start = INT_7XX_MPUIO_KEYPAD, 188 - .end = INT_7XX_MPUIO_KEYPAD, 189 - .flags = IORESOURCE_IRQ, 190 - }, 191 - }; 192 - 193 - static const struct matrix_keymap_data p2_keymap_data = { 194 - .keymap = p2_keymap, 195 - .keymap_size = ARRAY_SIZE(p2_keymap), 196 - }; 197 - 198 - static struct omap_kp_platform_data kp_data = { 199 - .rows = 8, 200 - .cols = 8, 201 - .keymap_data = &p2_keymap_data, 202 - .delay = 4, 203 - .dbounce = true, 204 - }; 205 - 206 - static struct platform_device kp_device = { 207 - .name = "omap-keypad", 208 - .id = -1, 209 - .dev = { 210 - .platform_data = &kp_data, 211 - }, 212 - .num_resources = ARRAY_SIZE(kp_resources), 213 - .resource = kp_resources, 214 - }; 215 - 216 - static struct platform_device *devices[] __initdata = { 217 - &nor_device, 218 - &nand_device, 219 - &smc91x_device, 220 - &kp_device, 221 - }; 222 - 223 - static const struct omap_lcd_config perseus2_lcd_config __initconst = { 224 - .ctrl_name = "internal", 225 - }; 226 - 227 - static void __init perseus2_init_smc91x(void) 228 - { 229 - __raw_writeb(1, H2P2_DBG_FPGA_LAN_RESET); 230 - mdelay(50); 231 - __raw_writeb(__raw_readb(H2P2_DBG_FPGA_LAN_RESET) & ~1, 232 - H2P2_DBG_FPGA_LAN_RESET); 233 - mdelay(50); 234 - } 235 - 236 - static void __init omap_perseus2_init(void) 237 - { 238 - /* Early, board-dependent init */ 239 - 240 - /* 241 - * Hold GSM Reset until needed 242 - */ 243 - omap_writew(omap_readw(OMAP7XX_DSP_M_CTL) & ~1, OMAP7XX_DSP_M_CTL); 244 - 245 - /* 246 - * UARTs -> done automagically by 8250 driver 247 - */ 248 - 249 - /* 250 - * CSx timings, GPIO Mux ... setup 251 - */ 252 - 253 - /* Flash: CS0 timings setup */ 254 - omap_writel(0x0000fff3, OMAP7XX_FLASH_CFG_0); 255 - omap_writel(0x00000088, OMAP7XX_FLASH_ACFG_0); 256 - 257 - /* 258 - * Ethernet support through the debug board 259 - * CS1 timings setup 260 - */ 261 - omap_writel(0x0000fff3, OMAP7XX_FLASH_CFG_1); 262 - omap_writel(0x00000000, OMAP7XX_FLASH_ACFG_1); 263 - 264 - /* 265 - * Configure MPU_EXT_NIRQ IO in IO_CONF9 register, 266 - * It is used as the Ethernet controller interrupt 267 - */ 268 - omap_writel(omap_readl(OMAP7XX_IO_CONF_9) & 0x1FFFFFFF, 269 - OMAP7XX_IO_CONF_9); 270 - 271 - perseus2_init_smc91x(); 272 - 273 - BUG_ON(gpio_request(P2_NAND_RB_GPIO_PIN, "NAND ready") < 0); 274 - gpio_direction_input(P2_NAND_RB_GPIO_PIN); 275 - 276 - omap_cfg_reg(L3_1610_FLASH_CS2B_OE); 277 - omap_cfg_reg(M8_1610_FLASH_CS2B_WE); 278 - 279 - /* Mux pins for keypad */ 280 - omap_cfg_reg(E2_7XX_KBR0); 281 - omap_cfg_reg(J7_7XX_KBR1); 282 - omap_cfg_reg(E1_7XX_KBR2); 283 - omap_cfg_reg(F3_7XX_KBR3); 284 - omap_cfg_reg(D2_7XX_KBR4); 285 - omap_cfg_reg(C2_7XX_KBC0); 286 - omap_cfg_reg(D3_7XX_KBC1); 287 - omap_cfg_reg(E4_7XX_KBC2); 288 - omap_cfg_reg(F4_7XX_KBC3); 289 - omap_cfg_reg(E3_7XX_KBC4); 290 - 291 - if (IS_ENABLED(CONFIG_SPI_OMAP_UWIRE)) { 292 - /* configure pins: MPU_UW_nSCS1, MPU_UW_SDO, MPU_UW_SCLK */ 293 - int val = omap_readl(OMAP7XX_IO_CONF_9) & ~0x00EEE000; 294 - omap_writel(val | 0x00AAA000, OMAP7XX_IO_CONF_9); 295 - } 296 - 297 - platform_add_devices(devices, ARRAY_SIZE(devices)); 298 - 299 - omap_serial_init(); 300 - omap_register_i2c_bus(1, 100, NULL, 0); 301 - 302 - omapfb_set_lcd_config(&perseus2_lcd_config); 303 - } 304 - 305 - /* Only FPGA needs to be mapped here. All others are done with ioremap */ 306 - static struct map_desc omap_perseus2_io_desc[] __initdata = { 307 - { 308 - .virtual = H2P2_DBG_FPGA_BASE, 309 - .pfn = __phys_to_pfn(H2P2_DBG_FPGA_START), 310 - .length = H2P2_DBG_FPGA_SIZE, 311 - .type = MT_DEVICE 312 - } 313 - }; 314 - 315 - static void __init omap_perseus2_map_io(void) 316 - { 317 - omap7xx_map_io(); 318 - iotable_init(omap_perseus2_io_desc, 319 - ARRAY_SIZE(omap_perseus2_io_desc)); 320 - } 321 - 322 - MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2") 323 - /* Maintainer: Kevin Hilman <kjh@hilman.org> */ 324 - .atag_offset = 0x100, 325 - .map_io = omap_perseus2_map_io, 326 - .init_early = omap1_init_early, 327 - .init_irq = omap1_init_irq, 328 - .handle_irq = omap1_handle_irq, 329 - .init_machine = omap_perseus2_init, 330 - .init_late = omap1_init_late, 331 - .init_time = omap1_timer_init, 332 - .restart = omap1_restart, 333 - MACHINE_END
-186
arch/arm/mach-omap1/fpga.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * linux/arch/arm/mach-omap1/fpga.c 4 - * 5 - * Interrupt handler for OMAP-1510 Innovator FPGA 6 - * 7 - * Copyright (C) 2001 RidgeRun, Inc. 8 - * Author: Greg Lonnon <glonnon@ridgerun.com> 9 - * 10 - * Copyright (C) 2002 MontaVista Software, Inc. 11 - * 12 - * Separated FPGA interrupts from innovator1510.c and cleaned up for 2.6 13 - * Copyright (C) 2004 Nokia Corporation by Tony Lindrgen <tony@atomide.com> 14 - */ 15 - 16 - #include <linux/types.h> 17 - #include <linux/gpio.h> 18 - #include <linux/init.h> 19 - #include <linux/kernel.h> 20 - #include <linux/device.h> 21 - #include <linux/errno.h> 22 - #include <linux/io.h> 23 - 24 - #include <asm/irq.h> 25 - #include <asm/mach/irq.h> 26 - 27 - #include "hardware.h" 28 - #include "iomap.h" 29 - #include "common.h" 30 - #include "fpga.h" 31 - 32 - static void fpga_mask_irq(struct irq_data *d) 33 - { 34 - unsigned int irq = d->irq - OMAP_FPGA_IRQ_BASE; 35 - 36 - if (irq < 8) 37 - __raw_writeb((__raw_readb(OMAP1510_FPGA_IMR_LO) 38 - & ~(1 << irq)), OMAP1510_FPGA_IMR_LO); 39 - else if (irq < 16) 40 - __raw_writeb((__raw_readb(OMAP1510_FPGA_IMR_HI) 41 - & ~(1 << (irq - 8))), OMAP1510_FPGA_IMR_HI); 42 - else 43 - __raw_writeb((__raw_readb(INNOVATOR_FPGA_IMR2) 44 - & ~(1 << (irq - 16))), INNOVATOR_FPGA_IMR2); 45 - } 46 - 47 - 48 - static inline u32 get_fpga_unmasked_irqs(void) 49 - { 50 - return 51 - ((__raw_readb(OMAP1510_FPGA_ISR_LO) & 52 - __raw_readb(OMAP1510_FPGA_IMR_LO))) | 53 - ((__raw_readb(OMAP1510_FPGA_ISR_HI) & 54 - __raw_readb(OMAP1510_FPGA_IMR_HI)) << 8) | 55 - ((__raw_readb(INNOVATOR_FPGA_ISR2) & 56 - __raw_readb(INNOVATOR_FPGA_IMR2)) << 16); 57 - } 58 - 59 - 60 - static void fpga_ack_irq(struct irq_data *d) 61 - { 62 - /* Don't need to explicitly ACK FPGA interrupts */ 63 - } 64 - 65 - static void fpga_unmask_irq(struct irq_data *d) 66 - { 67 - unsigned int irq = d->irq - OMAP_FPGA_IRQ_BASE; 68 - 69 - if (irq < 8) 70 - __raw_writeb((__raw_readb(OMAP1510_FPGA_IMR_LO) | (1 << irq)), 71 - OMAP1510_FPGA_IMR_LO); 72 - else if (irq < 16) 73 - __raw_writeb((__raw_readb(OMAP1510_FPGA_IMR_HI) 74 - | (1 << (irq - 8))), OMAP1510_FPGA_IMR_HI); 75 - else 76 - __raw_writeb((__raw_readb(INNOVATOR_FPGA_IMR2) 77 - | (1 << (irq - 16))), INNOVATOR_FPGA_IMR2); 78 - } 79 - 80 - static void fpga_mask_ack_irq(struct irq_data *d) 81 - { 82 - fpga_mask_irq(d); 83 - fpga_ack_irq(d); 84 - } 85 - 86 - static void innovator_fpga_IRQ_demux(struct irq_desc *desc) 87 - { 88 - u32 stat; 89 - int fpga_irq; 90 - 91 - stat = get_fpga_unmasked_irqs(); 92 - 93 - if (!stat) 94 - return; 95 - 96 - for (fpga_irq = OMAP_FPGA_IRQ_BASE; 97 - (fpga_irq < OMAP_FPGA_IRQ_END) && stat; 98 - fpga_irq++, stat >>= 1) { 99 - if (stat & 1) { 100 - generic_handle_irq(fpga_irq); 101 - } 102 - } 103 - } 104 - 105 - static struct irq_chip omap_fpga_irq_ack = { 106 - .name = "FPGA-ack", 107 - .irq_ack = fpga_mask_ack_irq, 108 - .irq_mask = fpga_mask_irq, 109 - .irq_unmask = fpga_unmask_irq, 110 - }; 111 - 112 - 113 - static struct irq_chip omap_fpga_irq = { 114 - .name = "FPGA", 115 - .irq_ack = fpga_ack_irq, 116 - .irq_mask = fpga_mask_irq, 117 - .irq_unmask = fpga_unmask_irq, 118 - }; 119 - 120 - /* 121 - * All of the FPGA interrupt request inputs except for the touchscreen are 122 - * edge-sensitive; the touchscreen is level-sensitive. The edge-sensitive 123 - * interrupts are acknowledged as a side-effect of reading the interrupt 124 - * status register from the FPGA. The edge-sensitive interrupt inputs 125 - * cause a problem with level interrupt requests, such as Ethernet. The 126 - * problem occurs when a level interrupt request is asserted while its 127 - * interrupt input is masked in the FPGA, which results in a missed 128 - * interrupt. 129 - * 130 - * In an attempt to workaround the problem with missed interrupts, the 131 - * mask_ack routine for all of the FPGA interrupts has been changed from 132 - * fpga_mask_ack_irq() to fpga_ack_irq() so that the specific FPGA interrupt 133 - * being serviced is left unmasked. We can do this because the FPGA cascade 134 - * interrupt is run with all interrupts masked. 135 - * 136 - * Limited testing indicates that this workaround appears to be effective 137 - * for the smc9194 Ethernet driver used on the Innovator. It should work 138 - * on other FPGA interrupts as well, but any drivers that explicitly mask 139 - * interrupts at the interrupt controller via disable_irq/enable_irq 140 - * could pose a problem. 141 - */ 142 - void omap1510_fpga_init_irq(void) 143 - { 144 - int i, res; 145 - 146 - __raw_writeb(0, OMAP1510_FPGA_IMR_LO); 147 - __raw_writeb(0, OMAP1510_FPGA_IMR_HI); 148 - __raw_writeb(0, INNOVATOR_FPGA_IMR2); 149 - 150 - for (i = OMAP_FPGA_IRQ_BASE; i < OMAP_FPGA_IRQ_END; i++) { 151 - 152 - if (i == OMAP1510_INT_FPGA_TS) { 153 - /* 154 - * The touchscreen interrupt is level-sensitive, so 155 - * we'll use the regular mask_ack routine for it. 156 - */ 157 - irq_set_chip(i, &omap_fpga_irq_ack); 158 - } 159 - else { 160 - /* 161 - * All FPGA interrupts except the touchscreen are 162 - * edge-sensitive, so we won't mask them. 163 - */ 164 - irq_set_chip(i, &omap_fpga_irq); 165 - } 166 - 167 - irq_set_handler(i, handle_edge_irq); 168 - irq_clear_status_flags(i, IRQ_NOREQUEST); 169 - } 170 - 171 - /* 172 - * The FPGA interrupt line is connected to GPIO13. Claim this pin for 173 - * the ARM. 174 - * 175 - * NOTE: For general GPIO/MPUIO access and interrupts, please see 176 - * gpio.[ch] 177 - */ 178 - res = gpio_request(13, "FPGA irq"); 179 - if (res) { 180 - pr_err("%s failed to get gpio\n", __func__); 181 - return; 182 - } 183 - gpio_direction_input(13); 184 - irq_set_irq_type(gpio_to_irq(13), IRQ_TYPE_EDGE_RISING); 185 - irq_set_chained_handler(OMAP1510_INT_FPGA, innovator_fpga_IRQ_demux); 186 - }
-49
arch/arm/mach-omap1/fpga.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* 3 - * Interrupt handler for OMAP-1510 FPGA 4 - * 5 - * Copyright (C) 2001 RidgeRun, Inc. 6 - * Author: Greg Lonnon <glonnon@ridgerun.com> 7 - * 8 - * Copyright (C) 2002 MontaVista Software, Inc. 9 - * 10 - * Separated FPGA interrupts from innovator1510.c and cleaned up for 2.6 11 - * Copyright (C) 2004 Nokia Corporation by Tony Lindrgen <tony@atomide.com> 12 - */ 13 - 14 - #ifndef __ASM_ARCH_OMAP_FPGA_H 15 - #define __ASM_ARCH_OMAP_FPGA_H 16 - 17 - /* 18 - * --------------------------------------------------------------------------- 19 - * H2/P2 Debug board FPGA 20 - * --------------------------------------------------------------------------- 21 - */ 22 - /* maps in the FPGA registers and the ETHR registers */ 23 - #define H2P2_DBG_FPGA_BASE 0xE8000000 /* VA */ 24 - #define H2P2_DBG_FPGA_SIZE SZ_4K /* SIZE */ 25 - #define H2P2_DBG_FPGA_START 0x04000000 /* PA */ 26 - 27 - #define H2P2_DBG_FPGA_ETHR_START (H2P2_DBG_FPGA_START + 0x300) 28 - #define H2P2_DBG_FPGA_FPGA_REV IOMEM(H2P2_DBG_FPGA_BASE + 0x10) /* FPGA Revision */ 29 - #define H2P2_DBG_FPGA_BOARD_REV IOMEM(H2P2_DBG_FPGA_BASE + 0x12) /* Board Revision */ 30 - #define H2P2_DBG_FPGA_GPIO IOMEM(H2P2_DBG_FPGA_BASE + 0x14) /* GPIO outputs */ 31 - #define H2P2_DBG_FPGA_LEDS IOMEM(H2P2_DBG_FPGA_BASE + 0x16) /* LEDs outputs */ 32 - #define H2P2_DBG_FPGA_MISC_INPUTS IOMEM(H2P2_DBG_FPGA_BASE + 0x18) /* Misc inputs */ 33 - #define H2P2_DBG_FPGA_LAN_STATUS IOMEM(H2P2_DBG_FPGA_BASE + 0x1A) /* LAN Status line */ 34 - #define H2P2_DBG_FPGA_LAN_RESET IOMEM(H2P2_DBG_FPGA_BASE + 0x1C) /* LAN Reset line */ 35 - 36 - /* LEDs definition on debug board (16 LEDs, all physically green) */ 37 - #define H2P2_DBG_FPGA_LED_GREEN (1 << 15) 38 - #define H2P2_DBG_FPGA_LED_AMBER (1 << 14) 39 - #define H2P2_DBG_FPGA_LED_RED (1 << 13) 40 - #define H2P2_DBG_FPGA_LED_BLUE (1 << 12) 41 - /* cpu0 load-meter LEDs */ 42 - #define H2P2_DBG_FPGA_LOAD_METER (1 << 0) // A bit of fun on our board ... 43 - #define H2P2_DBG_FPGA_LOAD_METER_SIZE 11 44 - #define H2P2_DBG_FPGA_LOAD_METER_MASK ((1 << H2P2_DBG_FPGA_LOAD_METER_SIZE) - 1) 45 - 46 - #define H2P2_DBG_FPGA_P2_LED_TIMER (1 << 0) 47 - #define H2P2_DBG_FPGA_P2_LED_IDLE (1 << 1) 48 - 49 - #endif
-272
arch/arm/mach-omap1/gpio7xx.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * OMAP7xx specific gpio init 4 - * 5 - * Copyright (C) 2010 Texas Instruments Incorporated - https://www.ti.com/ 6 - * 7 - * Author: 8 - * Charulatha V <charu@ti.com> 9 - */ 10 - 11 - #include <linux/gpio.h> 12 - #include <linux/platform_data/gpio-omap.h> 13 - 14 - #include "irqs.h" 15 - #include "soc.h" 16 - 17 - #define OMAP7XX_GPIO1_BASE 0xfffbc000 18 - #define OMAP7XX_GPIO2_BASE 0xfffbc800 19 - #define OMAP7XX_GPIO3_BASE 0xfffbd000 20 - #define OMAP7XX_GPIO4_BASE 0xfffbd800 21 - #define OMAP7XX_GPIO5_BASE 0xfffbe000 22 - #define OMAP7XX_GPIO6_BASE 0xfffbe800 23 - #define OMAP1_MPUIO_VBASE OMAP1_MPUIO_BASE 24 - 25 - /* mpu gpio */ 26 - static struct resource omap7xx_mpu_gpio_resources[] = { 27 - { 28 - .start = OMAP1_MPUIO_VBASE, 29 - .end = OMAP1_MPUIO_VBASE + SZ_2K - 1, 30 - .flags = IORESOURCE_MEM, 31 - }, 32 - { 33 - .start = INT_7XX_MPUIO, 34 - .flags = IORESOURCE_IRQ, 35 - }, 36 - }; 37 - 38 - static struct omap_gpio_reg_offs omap7xx_mpuio_regs = { 39 - .revision = USHRT_MAX, 40 - .direction = OMAP_MPUIO_IO_CNTL / 2, 41 - .datain = OMAP_MPUIO_INPUT_LATCH / 2, 42 - .dataout = OMAP_MPUIO_OUTPUT / 2, 43 - .irqstatus = OMAP_MPUIO_GPIO_INT / 2, 44 - .irqenable = OMAP_MPUIO_GPIO_MASKIT / 2, 45 - .irqenable_inv = true, 46 - .irqctrl = OMAP_MPUIO_GPIO_INT_EDGE >> 1, 47 - }; 48 - 49 - static struct omap_gpio_platform_data omap7xx_mpu_gpio_config = { 50 - .is_mpuio = true, 51 - .bank_width = 16, 52 - .bank_stride = 2, 53 - .regs = &omap7xx_mpuio_regs, 54 - }; 55 - 56 - static struct platform_device omap7xx_mpu_gpio = { 57 - .name = "omap_gpio", 58 - .id = 0, 59 - .dev = { 60 - .platform_data = &omap7xx_mpu_gpio_config, 61 - }, 62 - .num_resources = ARRAY_SIZE(omap7xx_mpu_gpio_resources), 63 - .resource = omap7xx_mpu_gpio_resources, 64 - }; 65 - 66 - /* gpio1 */ 67 - static struct resource omap7xx_gpio1_resources[] = { 68 - { 69 - .start = OMAP7XX_GPIO1_BASE, 70 - .end = OMAP7XX_GPIO1_BASE + SZ_2K - 1, 71 - .flags = IORESOURCE_MEM, 72 - }, 73 - { 74 - .start = INT_7XX_GPIO_BANK1, 75 - .flags = IORESOURCE_IRQ, 76 - }, 77 - }; 78 - 79 - static struct omap_gpio_reg_offs omap7xx_gpio_regs = { 80 - .revision = USHRT_MAX, 81 - .direction = OMAP7XX_GPIO_DIR_CONTROL, 82 - .datain = OMAP7XX_GPIO_DATA_INPUT, 83 - .dataout = OMAP7XX_GPIO_DATA_OUTPUT, 84 - .irqstatus = OMAP7XX_GPIO_INT_STATUS, 85 - .irqenable = OMAP7XX_GPIO_INT_MASK, 86 - .irqenable_inv = true, 87 - .irqctrl = OMAP7XX_GPIO_INT_CONTROL, 88 - }; 89 - 90 - static struct omap_gpio_platform_data omap7xx_gpio1_config = { 91 - .bank_width = 32, 92 - .regs = &omap7xx_gpio_regs, 93 - }; 94 - 95 - static struct platform_device omap7xx_gpio1 = { 96 - .name = "omap_gpio", 97 - .id = 1, 98 - .dev = { 99 - .platform_data = &omap7xx_gpio1_config, 100 - }, 101 - .num_resources = ARRAY_SIZE(omap7xx_gpio1_resources), 102 - .resource = omap7xx_gpio1_resources, 103 - }; 104 - 105 - /* gpio2 */ 106 - static struct resource omap7xx_gpio2_resources[] = { 107 - { 108 - .start = OMAP7XX_GPIO2_BASE, 109 - .end = OMAP7XX_GPIO2_BASE + SZ_2K - 1, 110 - .flags = IORESOURCE_MEM, 111 - }, 112 - { 113 - .start = INT_7XX_GPIO_BANK2, 114 - .flags = IORESOURCE_IRQ, 115 - }, 116 - }; 117 - 118 - static struct omap_gpio_platform_data omap7xx_gpio2_config = { 119 - .bank_width = 32, 120 - .regs = &omap7xx_gpio_regs, 121 - }; 122 - 123 - static struct platform_device omap7xx_gpio2 = { 124 - .name = "omap_gpio", 125 - .id = 2, 126 - .dev = { 127 - .platform_data = &omap7xx_gpio2_config, 128 - }, 129 - .num_resources = ARRAY_SIZE(omap7xx_gpio2_resources), 130 - .resource = omap7xx_gpio2_resources, 131 - }; 132 - 133 - /* gpio3 */ 134 - static struct resource omap7xx_gpio3_resources[] = { 135 - { 136 - .start = OMAP7XX_GPIO3_BASE, 137 - .end = OMAP7XX_GPIO3_BASE + SZ_2K - 1, 138 - .flags = IORESOURCE_MEM, 139 - }, 140 - { 141 - .start = INT_7XX_GPIO_BANK3, 142 - .flags = IORESOURCE_IRQ, 143 - }, 144 - }; 145 - 146 - static struct omap_gpio_platform_data omap7xx_gpio3_config = { 147 - .bank_width = 32, 148 - .regs = &omap7xx_gpio_regs, 149 - }; 150 - 151 - static struct platform_device omap7xx_gpio3 = { 152 - .name = "omap_gpio", 153 - .id = 3, 154 - .dev = { 155 - .platform_data = &omap7xx_gpio3_config, 156 - }, 157 - .num_resources = ARRAY_SIZE(omap7xx_gpio3_resources), 158 - .resource = omap7xx_gpio3_resources, 159 - }; 160 - 161 - /* gpio4 */ 162 - static struct resource omap7xx_gpio4_resources[] = { 163 - { 164 - .start = OMAP7XX_GPIO4_BASE, 165 - .end = OMAP7XX_GPIO4_BASE + SZ_2K - 1, 166 - .flags = IORESOURCE_MEM, 167 - }, 168 - { 169 - .start = INT_7XX_GPIO_BANK4, 170 - .flags = IORESOURCE_IRQ, 171 - }, 172 - }; 173 - 174 - static struct omap_gpio_platform_data omap7xx_gpio4_config = { 175 - .bank_width = 32, 176 - .regs = &omap7xx_gpio_regs, 177 - }; 178 - 179 - static struct platform_device omap7xx_gpio4 = { 180 - .name = "omap_gpio", 181 - .id = 4, 182 - .dev = { 183 - .platform_data = &omap7xx_gpio4_config, 184 - }, 185 - .num_resources = ARRAY_SIZE(omap7xx_gpio4_resources), 186 - .resource = omap7xx_gpio4_resources, 187 - }; 188 - 189 - /* gpio5 */ 190 - static struct resource omap7xx_gpio5_resources[] = { 191 - { 192 - .start = OMAP7XX_GPIO5_BASE, 193 - .end = OMAP7XX_GPIO5_BASE + SZ_2K - 1, 194 - .flags = IORESOURCE_MEM, 195 - }, 196 - { 197 - .start = INT_7XX_GPIO_BANK5, 198 - .flags = IORESOURCE_IRQ, 199 - }, 200 - }; 201 - 202 - static struct omap_gpio_platform_data omap7xx_gpio5_config = { 203 - .bank_width = 32, 204 - .regs = &omap7xx_gpio_regs, 205 - }; 206 - 207 - static struct platform_device omap7xx_gpio5 = { 208 - .name = "omap_gpio", 209 - .id = 5, 210 - .dev = { 211 - .platform_data = &omap7xx_gpio5_config, 212 - }, 213 - .num_resources = ARRAY_SIZE(omap7xx_gpio5_resources), 214 - .resource = omap7xx_gpio5_resources, 215 - }; 216 - 217 - /* gpio6 */ 218 - static struct resource omap7xx_gpio6_resources[] = { 219 - { 220 - .start = OMAP7XX_GPIO6_BASE, 221 - .end = OMAP7XX_GPIO6_BASE + SZ_2K - 1, 222 - .flags = IORESOURCE_MEM, 223 - }, 224 - { 225 - .start = INT_7XX_GPIO_BANK6, 226 - .flags = IORESOURCE_IRQ, 227 - }, 228 - }; 229 - 230 - static struct omap_gpio_platform_data omap7xx_gpio6_config = { 231 - .bank_width = 32, 232 - .regs = &omap7xx_gpio_regs, 233 - }; 234 - 235 - static struct platform_device omap7xx_gpio6 = { 236 - .name = "omap_gpio", 237 - .id = 6, 238 - .dev = { 239 - .platform_data = &omap7xx_gpio6_config, 240 - }, 241 - .num_resources = ARRAY_SIZE(omap7xx_gpio6_resources), 242 - .resource = omap7xx_gpio6_resources, 243 - }; 244 - 245 - static struct platform_device *omap7xx_gpio_dev[] __initdata = { 246 - &omap7xx_mpu_gpio, 247 - &omap7xx_gpio1, 248 - &omap7xx_gpio2, 249 - &omap7xx_gpio3, 250 - &omap7xx_gpio4, 251 - &omap7xx_gpio5, 252 - &omap7xx_gpio6, 253 - }; 254 - 255 - /* 256 - * omap7xx_gpio_init needs to be done before 257 - * machine_init functions access gpio APIs. 258 - * Hence omap7xx_gpio_init is a postcore_initcall. 259 - */ 260 - static int __init omap7xx_gpio_init(void) 261 - { 262 - int i; 263 - 264 - if (!cpu_is_omap7xx()) 265 - return -EINVAL; 266 - 267 - for (i = 0; i < ARRAY_SIZE(omap7xx_gpio_dev); i++) 268 - platform_device_register(omap7xx_gpio_dev[i]); 269 - 270 - return 0; 271 - } 272 - postcore_initcall(omap7xx_gpio_init);
+1 -1
drivers/i2c/busses/Kconfig
··· 874 874 config I2C_OMAP 875 875 tristate "OMAP I2C adapter" 876 876 depends on ARCH_OMAP || ARCH_K3 || COMPILE_TEST 877 - default y if MACH_OMAP_H3 || MACH_OMAP_OSK 877 + default MACH_OMAP_OSK 878 878 help 879 879 If you say yes to this option, support will be included for the 880 880 I2C interface on the Texas Instruments OMAP1/2 family of processors.
+1 -1
drivers/mfd/Kconfig
··· 1514 1514 config TPS65010 1515 1515 tristate "TI TPS6501x Power Management chips" 1516 1516 depends on I2C && GPIOLIB 1517 - default y if MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_OMAP_OSK 1517 + default MACH_OMAP_OSK 1518 1518 help 1519 1519 If you say yes here you get support for the TPS6501x series of 1520 1520 Power Management chips. These include voltage regulators,
+1 -1
drivers/mmc/host/Kconfig
··· 489 489 config MMC_OMAP 490 490 tristate "TI OMAP Multimedia Card Interface support" 491 491 depends on ARCH_OMAP 492 - depends on TPS65010 || !MACH_OMAP_H2 492 + depends on TPS65010 493 493 help 494 494 This selects the TI OMAP Multimedia card Interface. 495 495 If you have an OMAP board with a Multimedia Card slot,
-1
drivers/usb/gadget/udc/Kconfig
··· 118 118 config USB_OMAP 119 119 tristate "OMAP USB Device Controller" 120 120 depends on ARCH_OMAP1 121 - depends on ISP1301_OMAP || !(MACH_OMAP_H2 || MACH_OMAP_H3) 122 121 help 123 122 Many Texas Instruments OMAP processors have flexible full 124 123 speed USB device controllers, with support for up to 30
-1
drivers/usb/host/Kconfig
··· 409 409 config USB_OHCI_HCD_OMAP1 410 410 tristate "OHCI support for OMAP1/2 chips" 411 411 depends on ARCH_OMAP1 412 - depends on ISP1301_OMAP || !(MACH_OMAP_H2 || MACH_OMAP_H3) 413 412 default y 414 413 help 415 414 Enables support for the OHCI controller on OMAP1/2 chips.
-19
include/linux/platform_data/leds-omap.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* 3 - * Copyright (C) 2006 Samsung Electronics 4 - * Kyungmin Park <kyungmin.park@samsung.com> 5 - */ 6 - #ifndef ASMARM_ARCH_LED_H 7 - #define ASMARM_ARCH_LED_H 8 - 9 - struct omap_led_config { 10 - struct led_classdev cdev; 11 - s16 gpio; 12 - }; 13 - 14 - struct omap_led_platform_data { 15 - s16 nr_leds; 16 - struct omap_led_config *leds; 17 - }; 18 - 19 - #endif