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

ARM: ixp4xx: Drop all common code

After moving away from all the code we depend on in common we can
get a clean device tree boot and delete the common code in
arch/arm/mach-ixp4xx/common.c altogether.

Two physical register addresses remain in use, just copy these
verbatim into uncompress.h.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20220211223238.648934-13-linus.walleij@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

+4 -826
+1 -1
arch/arm/mach-ixp4xx/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 - obj-y += ixp4xx-of.o common.o 2 + obj-y += ixp4xx-of.o
-331
arch/arm/mach-ixp4xx/common.c
··· 1 - /* 2 - * arch/arm/mach-ixp4xx/common.c 3 - * 4 - * Generic code shared across all IXP4XX platforms 5 - * 6 - * Maintainer: Deepak Saxena <dsaxena@plexity.net> 7 - * 8 - * Copyright 2002 (c) Intel Corporation 9 - * Copyright 2003-2004 (c) MontaVista, Software, Inc. 10 - * 11 - * This file is licensed under the terms of the GNU General Public 12 - * License version 2. This program is licensed "as is" without any 13 - * warranty of any kind, whether express or implied. 14 - */ 15 - 16 - #include <linux/kernel.h> 17 - #include <linux/mm.h> 18 - #include <linux/init.h> 19 - #include <linux/serial.h> 20 - #include <linux/tty.h> 21 - #include <linux/platform_device.h> 22 - #include <linux/serial_core.h> 23 - #include <linux/interrupt.h> 24 - #include <linux/bitops.h> 25 - #include <linux/io.h> 26 - #include <linux/export.h> 27 - #include <linux/cpu.h> 28 - #include <linux/pci.h> 29 - #include <linux/sched_clock.h> 30 - #include <linux/soc/ixp4xx/cpu.h> 31 - #include <linux/irqchip/irq-ixp4xx.h> 32 - #include <linux/platform_data/timer-ixp4xx.h> 33 - #include <mach/hardware.h> 34 - #include <linux/uaccess.h> 35 - #include <asm/page.h> 36 - #include <asm/exception.h> 37 - #include <asm/irq.h> 38 - #include <asm/system_misc.h> 39 - #include <asm/mach/map.h> 40 - #include <asm/mach/irq.h> 41 - #include <asm/mach/time.h> 42 - 43 - #include "irqs.h" 44 - 45 - #define IXP4XX_TIMER_FREQ 66666000 46 - 47 - /************************************************************************* 48 - * IXP4xx chipset I/O mapping 49 - *************************************************************************/ 50 - static struct map_desc ixp4xx_io_desc[] __initdata = { 51 - { /* UART, Interrupt ctrl, GPIO, timers, NPEs, MACs, USB .... */ 52 - .virtual = (unsigned long)IXP4XX_PERIPHERAL_BASE_VIRT, 53 - .pfn = __phys_to_pfn(IXP4XX_PERIPHERAL_BASE_PHYS), 54 - .length = IXP4XX_PERIPHERAL_REGION_SIZE, 55 - .type = MT_DEVICE 56 - }, { /* Expansion Bus Config Registers */ 57 - .virtual = (unsigned long)IXP4XX_EXP_CFG_BASE_VIRT, 58 - .pfn = __phys_to_pfn(IXP4XX_EXP_CFG_BASE_PHYS), 59 - .length = IXP4XX_EXP_CFG_REGION_SIZE, 60 - .type = MT_DEVICE 61 - }, { /* PCI Registers */ 62 - .virtual = (unsigned long)IXP4XX_PCI_CFG_BASE_VIRT, 63 - .pfn = __phys_to_pfn(IXP4XX_PCI_CFG_BASE_PHYS), 64 - .length = IXP4XX_PCI_CFG_REGION_SIZE, 65 - .type = MT_DEVICE 66 - }, 67 - }; 68 - 69 - void __init ixp4xx_map_io(void) 70 - { 71 - iotable_init(ixp4xx_io_desc, ARRAY_SIZE(ixp4xx_io_desc)); 72 - } 73 - 74 - void __init ixp4xx_init_irq(void) 75 - { 76 - /* 77 - * ixp4xx does not implement the XScale PWRMODE register 78 - * so it must not call cpu_do_idle(). 79 - */ 80 - cpu_idle_poll_ctrl(true); 81 - 82 - ixp4xx_irq_init(IXP4XX_INTC_BASE_PHYS, 83 - (cpu_is_ixp46x() || cpu_is_ixp43x())); 84 - } 85 - 86 - void __init ixp4xx_timer_init(void) 87 - { 88 - return ixp4xx_timer_setup(IXP4XX_TIMER_BASE_PHYS, 89 - IRQ_IXP4XX_TIMER1, 90 - IXP4XX_TIMER_FREQ); 91 - } 92 - 93 - static struct resource ixp4xx_udc_resources[] = { 94 - [0] = { 95 - .start = 0xc800b000, 96 - .end = 0xc800bfff, 97 - .flags = IORESOURCE_MEM, 98 - }, 99 - [1] = { 100 - .start = IRQ_IXP4XX_USB, 101 - .end = IRQ_IXP4XX_USB, 102 - .flags = IORESOURCE_IRQ, 103 - }, 104 - }; 105 - 106 - static struct resource ixp4xx_gpio_resource[] = { 107 - { 108 - .start = IXP4XX_GPIO_BASE_PHYS, 109 - .end = IXP4XX_GPIO_BASE_PHYS + 0xfff, 110 - .flags = IORESOURCE_MEM, 111 - }, 112 - }; 113 - 114 - static struct platform_device ixp4xx_gpio_device = { 115 - .name = "ixp4xx-gpio", 116 - .id = -1, 117 - .dev = { 118 - .coherent_dma_mask = DMA_BIT_MASK(32), 119 - }, 120 - .resource = ixp4xx_gpio_resource, 121 - .num_resources = ARRAY_SIZE(ixp4xx_gpio_resource), 122 - }; 123 - 124 - /* 125 - * USB device controller. The IXP4xx uses the same controller as PXA25X, 126 - * so we just use the same device. 127 - */ 128 - static struct platform_device ixp4xx_udc_device = { 129 - .name = "pxa25x-udc", 130 - .id = -1, 131 - .num_resources = 2, 132 - .resource = ixp4xx_udc_resources, 133 - }; 134 - 135 - static struct resource ixp4xx_npe_resources[] = { 136 - { 137 - .start = IXP4XX_NPEA_BASE_PHYS, 138 - .end = IXP4XX_NPEA_BASE_PHYS + 0xfff, 139 - .flags = IORESOURCE_MEM, 140 - }, 141 - { 142 - .start = IXP4XX_NPEB_BASE_PHYS, 143 - .end = IXP4XX_NPEB_BASE_PHYS + 0xfff, 144 - .flags = IORESOURCE_MEM, 145 - }, 146 - { 147 - .start = IXP4XX_NPEC_BASE_PHYS, 148 - .end = IXP4XX_NPEC_BASE_PHYS + 0xfff, 149 - .flags = IORESOURCE_MEM, 150 - }, 151 - 152 - }; 153 - 154 - static struct platform_device ixp4xx_npe_device = { 155 - .name = "ixp4xx-npe", 156 - .id = -1, 157 - .num_resources = ARRAY_SIZE(ixp4xx_npe_resources), 158 - .resource = ixp4xx_npe_resources, 159 - }; 160 - 161 - static struct resource ixp4xx_qmgr_resources[] = { 162 - { 163 - .start = IXP4XX_QMGR_BASE_PHYS, 164 - .end = IXP4XX_QMGR_BASE_PHYS + 0x3fff, 165 - .flags = IORESOURCE_MEM, 166 - }, 167 - { 168 - .start = IRQ_IXP4XX_QM1, 169 - .end = IRQ_IXP4XX_QM1, 170 - .flags = IORESOURCE_IRQ, 171 - }, 172 - { 173 - .start = IRQ_IXP4XX_QM2, 174 - .end = IRQ_IXP4XX_QM2, 175 - .flags = IORESOURCE_IRQ, 176 - }, 177 - }; 178 - 179 - static struct platform_device ixp4xx_qmgr_device = { 180 - .name = "ixp4xx-qmgr", 181 - .id = -1, 182 - .num_resources = ARRAY_SIZE(ixp4xx_qmgr_resources), 183 - .resource = ixp4xx_qmgr_resources, 184 - }; 185 - 186 - static struct platform_device *ixp4xx_devices[] __initdata = { 187 - &ixp4xx_npe_device, 188 - &ixp4xx_qmgr_device, 189 - &ixp4xx_gpio_device, 190 - &ixp4xx_udc_device, 191 - }; 192 - 193 - static struct resource ixp46x_i2c_resources[] = { 194 - [0] = { 195 - .start = 0xc8011000, 196 - .end = 0xc801101c, 197 - .flags = IORESOURCE_MEM, 198 - }, 199 - [1] = { 200 - .start = IRQ_IXP4XX_I2C, 201 - .end = IRQ_IXP4XX_I2C, 202 - .flags = IORESOURCE_IRQ 203 - } 204 - }; 205 - 206 - /* A single 32-bit register on IXP46x */ 207 - #define IXP4XX_HWRANDOM_BASE_PHYS 0x70002100 208 - 209 - static struct resource ixp46x_hwrandom_resource[] = { 210 - { 211 - .start = IXP4XX_HWRANDOM_BASE_PHYS, 212 - .end = IXP4XX_HWRANDOM_BASE_PHYS + 0x3, 213 - .flags = IORESOURCE_MEM, 214 - }, 215 - }; 216 - 217 - static struct platform_device ixp46x_hwrandom_device = { 218 - .name = "ixp4xx-hwrandom", 219 - .id = -1, 220 - .dev = { 221 - .coherent_dma_mask = DMA_BIT_MASK(32), 222 - }, 223 - .resource = ixp46x_hwrandom_resource, 224 - .num_resources = ARRAY_SIZE(ixp46x_hwrandom_resource), 225 - }; 226 - 227 - /* 228 - * I2C controller. The IXP46x uses the same block as the IOP3xx, so 229 - * we just use the same device name. 230 - */ 231 - static struct platform_device ixp46x_i2c_controller = { 232 - .name = "IOP3xx-I2C", 233 - .id = 0, 234 - .num_resources = 2, 235 - .resource = ixp46x_i2c_resources 236 - }; 237 - 238 - static struct resource ixp46x_ptp_resources[] = { 239 - DEFINE_RES_MEM(IXP4XX_TIMESYNC_BASE_PHYS, SZ_4K), 240 - DEFINE_RES_IRQ_NAMED(IRQ_IXP4XX_GPIO8, "master"), 241 - DEFINE_RES_IRQ_NAMED(IRQ_IXP4XX_GPIO7, "slave"), 242 - }; 243 - 244 - static struct platform_device ixp46x_ptp = { 245 - .name = "ptp-ixp46x", 246 - .id = -1, 247 - .resource = ixp46x_ptp_resources, 248 - .num_resources = ARRAY_SIZE(ixp46x_ptp_resources), 249 - }; 250 - 251 - static struct platform_device *ixp46x_devices[] __initdata = { 252 - &ixp46x_hwrandom_device, 253 - &ixp46x_i2c_controller, 254 - &ixp46x_ptp, 255 - }; 256 - 257 - unsigned long ixp4xx_exp_bus_size; 258 - EXPORT_SYMBOL(ixp4xx_exp_bus_size); 259 - 260 - static struct platform_device_info ixp_dev_info __initdata = { 261 - .name = "ixp4xx_crypto", 262 - .id = 0, 263 - .dma_mask = DMA_BIT_MASK(32), 264 - }; 265 - 266 - static int __init ixp_crypto_register(void) 267 - { 268 - struct platform_device *pdev; 269 - 270 - if (!(~(*IXP4XX_EXP_CFG2) & (IXP4XX_FEATURE_HASH | 271 - IXP4XX_FEATURE_AES | IXP4XX_FEATURE_DES))) { 272 - printk(KERN_ERR "ixp_crypto: No HW crypto available\n"); 273 - return -ENODEV; 274 - } 275 - 276 - pdev = platform_device_register_full(&ixp_dev_info); 277 - if (IS_ERR(pdev)) 278 - return PTR_ERR(pdev); 279 - 280 - return 0; 281 - } 282 - 283 - void __init ixp4xx_sys_init(void) 284 - { 285 - ixp4xx_exp_bus_size = SZ_16M; 286 - 287 - platform_add_devices(ixp4xx_devices, ARRAY_SIZE(ixp4xx_devices)); 288 - 289 - if (IS_ENABLED(CONFIG_CRYPTO_DEV_IXP4XX)) 290 - ixp_crypto_register(); 291 - 292 - if (cpu_is_ixp46x()) { 293 - int region; 294 - 295 - platform_add_devices(ixp46x_devices, 296 - ARRAY_SIZE(ixp46x_devices)); 297 - 298 - for (region = 0; region < 7; region++) { 299 - if((*(IXP4XX_EXP_REG(0x4 * region)) & 0x200)) { 300 - ixp4xx_exp_bus_size = SZ_32M; 301 - break; 302 - } 303 - } 304 - } 305 - 306 - printk("IXP4xx: Using %luMiB expansion bus window size\n", 307 - ixp4xx_exp_bus_size >> 20); 308 - } 309 - 310 - unsigned long ixp4xx_timer_freq = IXP4XX_TIMER_FREQ; 311 - EXPORT_SYMBOL(ixp4xx_timer_freq); 312 - 313 - void ixp4xx_restart(enum reboot_mode mode, const char *cmd) 314 - { 315 - if (mode == REBOOT_SOFT) { 316 - /* Jump into ROM at address 0 */ 317 - soft_restart(0); 318 - } else { 319 - /* Use on-chip reset capability */ 320 - 321 - /* set the "key" register to enable access to 322 - * "timer" and "enable" registers 323 - */ 324 - *IXP4XX_OSWK = IXP4XX_WDT_KEY; 325 - 326 - /* write 0 to the timer register for an immediate reset */ 327 - *IXP4XX_OSWT = 0; 328 - 329 - *IXP4XX_OSWE = IXP4XX_WDT_RESET_ENABLE | IXP4XX_WDT_COUNT_ENABLE; 330 - } 331 - }
-26
arch/arm/mach-ixp4xx/include/mach/hardware.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* 3 - * arch/arm/mach-ixp4xx/include/mach/hardware.h 4 - * 5 - * Copyright (C) 2002 Intel Corporation. 6 - * Copyright (C) 2003-2004 MontaVista Software, Inc. 7 - */ 8 - 9 - /* 10 - * Hardware definitions for IXP4xx based systems 11 - */ 12 - 13 - #ifndef __ASM_ARCH_HARDWARE_H__ 14 - #define __ASM_ARCH_HARDWARE_H__ 15 - 16 - /* Register locations and bits */ 17 - #include "ixp4xx-regs.h" 18 - 19 - #ifndef __ASSEMBLER__ 20 - #include <linux/soc/ixp4xx/cpu.h> 21 - #endif 22 - 23 - /* Platform helper functions and definitions */ 24 - #include "platform.h" 25 - 26 - #endif /* _ASM_ARCH_HARDWARE_H */
-303
arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* 3 - * arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h 4 - * 5 - * Register definitions for IXP4xx chipset. This file contains 6 - * register location and bit definitions only. Platform specific 7 - * definitions and helper function declarations are in platform.h 8 - * and machine-name.h. 9 - * 10 - * Copyright (C) 2002 Intel Corporation. 11 - * Copyright (C) 2003-2004 MontaVista Software, Inc. 12 - */ 13 - 14 - #ifndef _ASM_ARM_IXP4XX_H_ 15 - #define _ASM_ARM_IXP4XX_H_ 16 - 17 - /* 18 - * IXP4xx Linux Memory Map: 19 - * 20 - * Phy Size Virt Description 21 - * ========================================================================= 22 - * 23 - * 0x00000000 0x10000000(max) PAGE_OFFSET System RAM 24 - * 25 - * 0x48000000 0x04000000 ioremap'd PCI Memory Space 26 - * 27 - * 0x50000000 0x10000000 ioremap'd EXP BUS 28 - * 29 - * 0xC8000000 0x00013000 0xFEF00000 On-Chip Peripherals 30 - * 31 - * 0xC0000000 0x00001000 0xFEF13000 PCI CFG 32 - * 33 - * 0xC4000000 0x00001000 0xFEF14000 EXP CFG 34 - * 35 - * 0x60000000 0x00004000 0xFEF15000 QMgr 36 - */ 37 - 38 - /* 39 - * Queue Manager 40 - */ 41 - #define IXP4XX_QMGR_BASE_PHYS 0x60000000 42 - 43 - /* 44 - * Peripheral space, including debug UART. Must be section-aligned so that 45 - * it can be used with the low-level debug code. 46 - */ 47 - #define IXP4XX_PERIPHERAL_BASE_PHYS 0xC8000000 48 - #define IXP4XX_PERIPHERAL_BASE_VIRT IOMEM(0xFEC00000) 49 - #define IXP4XX_PERIPHERAL_REGION_SIZE 0x00013000 50 - 51 - /* 52 - * PCI Config registers 53 - */ 54 - #define IXP4XX_PCI_CFG_BASE_PHYS 0xC0000000 55 - #define IXP4XX_PCI_CFG_BASE_VIRT IOMEM(0xFEC13000) 56 - #define IXP4XX_PCI_CFG_REGION_SIZE 0x00001000 57 - 58 - /* 59 - * Expansion BUS Configuration registers 60 - */ 61 - #define IXP4XX_EXP_CFG_BASE_PHYS 0xC4000000 62 - #define IXP4XX_EXP_CFG_BASE_VIRT 0xFEC14000 63 - #define IXP4XX_EXP_CFG_REGION_SIZE 0x00001000 64 - 65 - #define IXP4XX_EXP_CS0_OFFSET 0x00 66 - #define IXP4XX_EXP_CS1_OFFSET 0x04 67 - #define IXP4XX_EXP_CS2_OFFSET 0x08 68 - #define IXP4XX_EXP_CS3_OFFSET 0x0C 69 - #define IXP4XX_EXP_CS4_OFFSET 0x10 70 - #define IXP4XX_EXP_CS5_OFFSET 0x14 71 - #define IXP4XX_EXP_CS6_OFFSET 0x18 72 - #define IXP4XX_EXP_CS7_OFFSET 0x1C 73 - #define IXP4XX_EXP_CFG0_OFFSET 0x20 74 - #define IXP4XX_EXP_CFG1_OFFSET 0x24 75 - #define IXP4XX_EXP_CFG2_OFFSET 0x28 76 - #define IXP4XX_EXP_CFG3_OFFSET 0x2C 77 - 78 - /* 79 - * Expansion Bus Controller registers. 80 - */ 81 - #define IXP4XX_EXP_REG(x) ((volatile u32 __iomem *)(IXP4XX_EXP_CFG_BASE_VIRT+(x))) 82 - 83 - #define IXP4XX_EXP_CS0 IXP4XX_EXP_REG(IXP4XX_EXP_CS0_OFFSET) 84 - #define IXP4XX_EXP_CS1 IXP4XX_EXP_REG(IXP4XX_EXP_CS1_OFFSET) 85 - #define IXP4XX_EXP_CS2 IXP4XX_EXP_REG(IXP4XX_EXP_CS2_OFFSET) 86 - #define IXP4XX_EXP_CS3 IXP4XX_EXP_REG(IXP4XX_EXP_CS3_OFFSET) 87 - #define IXP4XX_EXP_CS4 IXP4XX_EXP_REG(IXP4XX_EXP_CS4_OFFSET) 88 - #define IXP4XX_EXP_CS5 IXP4XX_EXP_REG(IXP4XX_EXP_CS5_OFFSET) 89 - #define IXP4XX_EXP_CS6 IXP4XX_EXP_REG(IXP4XX_EXP_CS6_OFFSET) 90 - #define IXP4XX_EXP_CS7 IXP4XX_EXP_REG(IXP4XX_EXP_CS7_OFFSET) 91 - 92 - #define IXP4XX_EXP_CFG0 IXP4XX_EXP_REG(IXP4XX_EXP_CFG0_OFFSET) 93 - #define IXP4XX_EXP_CFG1 IXP4XX_EXP_REG(IXP4XX_EXP_CFG1_OFFSET) 94 - #define IXP4XX_EXP_CFG2 IXP4XX_EXP_REG(IXP4XX_EXP_CFG2_OFFSET) 95 - #define IXP4XX_EXP_CFG3 IXP4XX_EXP_REG(IXP4XX_EXP_CFG3_OFFSET) 96 - 97 - 98 - /* 99 - * Peripheral Space Register Region Base Addresses 100 - */ 101 - #define IXP4XX_UART1_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x0000) 102 - #define IXP4XX_UART2_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x1000) 103 - #define IXP4XX_PMU_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x2000) 104 - #define IXP4XX_INTC_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x3000) 105 - #define IXP4XX_GPIO_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x4000) 106 - #define IXP4XX_TIMER_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x5000) 107 - #define IXP4XX_NPEA_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x6000) 108 - #define IXP4XX_NPEB_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x7000) 109 - #define IXP4XX_NPEC_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x8000) 110 - #define IXP4XX_EthB_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x9000) 111 - #define IXP4XX_EthC_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xA000) 112 - #define IXP4XX_USB_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xB000) 113 - /* ixp46X only */ 114 - #define IXP4XX_EthA_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xC000) 115 - #define IXP4XX_EthB1_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xD000) 116 - #define IXP4XX_EthB2_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xE000) 117 - #define IXP4XX_EthB3_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xF000) 118 - #define IXP4XX_TIMESYNC_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x10000) 119 - #define IXP4XX_I2C_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x11000) 120 - #define IXP4XX_SSP_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x12000) 121 - 122 - 123 - /* The UART is explicitly put in the beginning of fixmap */ 124 - #define IXP4XX_UART1_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x0000) 125 - #define IXP4XX_UART2_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x1000) 126 - #define IXP4XX_PMU_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x2000) 127 - #define IXP4XX_INTC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x3000) 128 - #define IXP4XX_GPIO_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x4000) 129 - #define IXP4XX_TIMER_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x5000) 130 - #define IXP4XX_EthB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x9000) 131 - #define IXP4XX_EthC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xA000) 132 - #define IXP4XX_USB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xB000) 133 - /* ixp46X only */ 134 - #define IXP4XX_EthA_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xC000) 135 - #define IXP4XX_EthB1_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xD000) 136 - #define IXP4XX_EthB2_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xE000) 137 - #define IXP4XX_EthB3_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xF000) 138 - #define IXP4XX_TIMESYNC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x10000) 139 - #define IXP4XX_I2C_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x11000) 140 - #define IXP4XX_SSP_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x12000) 141 - 142 - /* 143 - * Constants to make it easy to access Timer Control/Status registers 144 - */ 145 - #define IXP4XX_OSTS_OFFSET 0x00 /* Continious TimeStamp */ 146 - #define IXP4XX_OST1_OFFSET 0x04 /* Timer 1 Timestamp */ 147 - #define IXP4XX_OSRT1_OFFSET 0x08 /* Timer 1 Reload */ 148 - #define IXP4XX_OST2_OFFSET 0x0C /* Timer 2 Timestamp */ 149 - #define IXP4XX_OSRT2_OFFSET 0x10 /* Timer 2 Reload */ 150 - #define IXP4XX_OSWT_OFFSET 0x14 /* Watchdog Timer */ 151 - #define IXP4XX_OSWE_OFFSET 0x18 /* Watchdog Enable */ 152 - #define IXP4XX_OSWK_OFFSET 0x1C /* Watchdog Key */ 153 - #define IXP4XX_OSST_OFFSET 0x20 /* Timer Status */ 154 - 155 - /* 156 - * Operating System Timer Register Definitions. 157 - */ 158 - 159 - #define IXP4XX_TIMER_REG(x) ((volatile u32 *)(IXP4XX_TIMER_BASE_VIRT+(x))) 160 - 161 - #define IXP4XX_OSTS IXP4XX_TIMER_REG(IXP4XX_OSTS_OFFSET) 162 - #define IXP4XX_OST1 IXP4XX_TIMER_REG(IXP4XX_OST1_OFFSET) 163 - #define IXP4XX_OSRT1 IXP4XX_TIMER_REG(IXP4XX_OSRT1_OFFSET) 164 - #define IXP4XX_OST2 IXP4XX_TIMER_REG(IXP4XX_OST2_OFFSET) 165 - #define IXP4XX_OSRT2 IXP4XX_TIMER_REG(IXP4XX_OSRT2_OFFSET) 166 - #define IXP4XX_OSWT IXP4XX_TIMER_REG(IXP4XX_OSWT_OFFSET) 167 - #define IXP4XX_OSWE IXP4XX_TIMER_REG(IXP4XX_OSWE_OFFSET) 168 - #define IXP4XX_OSWK IXP4XX_TIMER_REG(IXP4XX_OSWK_OFFSET) 169 - #define IXP4XX_OSST IXP4XX_TIMER_REG(IXP4XX_OSST_OFFSET) 170 - 171 - /* 172 - * Timer register values and bit definitions 173 - */ 174 - #define IXP4XX_OST_ENABLE 0x00000001 175 - #define IXP4XX_OST_ONE_SHOT 0x00000002 176 - /* Low order bits of reload value ignored */ 177 - #define IXP4XX_OST_RELOAD_MASK 0x00000003 178 - #define IXP4XX_OST_DISABLED 0x00000000 179 - #define IXP4XX_OSST_TIMER_1_PEND 0x00000001 180 - #define IXP4XX_OSST_TIMER_2_PEND 0x00000002 181 - #define IXP4XX_OSST_TIMER_TS_PEND 0x00000004 182 - #define IXP4XX_OSST_TIMER_WDOG_PEND 0x00000008 183 - #define IXP4XX_OSST_TIMER_WARM_RESET 0x00000010 184 - 185 - #define IXP4XX_WDT_KEY 0x0000482E 186 - 187 - #define IXP4XX_WDT_RESET_ENABLE 0x00000001 188 - #define IXP4XX_WDT_IRQ_ENABLE 0x00000002 189 - #define IXP4XX_WDT_COUNT_ENABLE 0x00000004 190 - 191 - 192 - /* 193 - * Constants to make it easy to access PCI Control/Status registers 194 - */ 195 - #define PCI_NP_AD_OFFSET 0x00 196 - #define PCI_NP_CBE_OFFSET 0x04 197 - #define PCI_NP_WDATA_OFFSET 0x08 198 - #define PCI_NP_RDATA_OFFSET 0x0c 199 - #define PCI_CRP_AD_CBE_OFFSET 0x10 200 - #define PCI_CRP_WDATA_OFFSET 0x14 201 - #define PCI_CRP_RDATA_OFFSET 0x18 202 - #define PCI_CSR_OFFSET 0x1c 203 - #define PCI_ISR_OFFSET 0x20 204 - #define PCI_INTEN_OFFSET 0x24 205 - #define PCI_DMACTRL_OFFSET 0x28 206 - #define PCI_AHBMEMBASE_OFFSET 0x2c 207 - #define PCI_AHBIOBASE_OFFSET 0x30 208 - #define PCI_PCIMEMBASE_OFFSET 0x34 209 - #define PCI_AHBDOORBELL_OFFSET 0x38 210 - #define PCI_PCIDOORBELL_OFFSET 0x3C 211 - #define PCI_ATPDMA0_AHBADDR_OFFSET 0x40 212 - #define PCI_ATPDMA0_PCIADDR_OFFSET 0x44 213 - #define PCI_ATPDMA0_LENADDR_OFFSET 0x48 214 - #define PCI_ATPDMA1_AHBADDR_OFFSET 0x4C 215 - #define PCI_ATPDMA1_PCIADDR_OFFSET 0x50 216 - #define PCI_ATPDMA1_LENADDR_OFFSET 0x54 217 - 218 - /* 219 - * PCI Control/Status Registers 220 - */ 221 - #define _IXP4XX_PCI_CSR(x) ((volatile u32 *)(IXP4XX_PCI_CFG_BASE_VIRT+(x))) 222 - 223 - #define PCI_NP_AD _IXP4XX_PCI_CSR(PCI_NP_AD_OFFSET) 224 - #define PCI_NP_CBE _IXP4XX_PCI_CSR(PCI_NP_CBE_OFFSET) 225 - #define PCI_NP_WDATA _IXP4XX_PCI_CSR(PCI_NP_WDATA_OFFSET) 226 - #define PCI_NP_RDATA _IXP4XX_PCI_CSR(PCI_NP_RDATA_OFFSET) 227 - #define PCI_CRP_AD_CBE _IXP4XX_PCI_CSR(PCI_CRP_AD_CBE_OFFSET) 228 - #define PCI_CRP_WDATA _IXP4XX_PCI_CSR(PCI_CRP_WDATA_OFFSET) 229 - #define PCI_CRP_RDATA _IXP4XX_PCI_CSR(PCI_CRP_RDATA_OFFSET) 230 - #define PCI_CSR _IXP4XX_PCI_CSR(PCI_CSR_OFFSET) 231 - #define PCI_ISR _IXP4XX_PCI_CSR(PCI_ISR_OFFSET) 232 - #define PCI_INTEN _IXP4XX_PCI_CSR(PCI_INTEN_OFFSET) 233 - #define PCI_DMACTRL _IXP4XX_PCI_CSR(PCI_DMACTRL_OFFSET) 234 - #define PCI_AHBMEMBASE _IXP4XX_PCI_CSR(PCI_AHBMEMBASE_OFFSET) 235 - #define PCI_AHBIOBASE _IXP4XX_PCI_CSR(PCI_AHBIOBASE_OFFSET) 236 - #define PCI_PCIMEMBASE _IXP4XX_PCI_CSR(PCI_PCIMEMBASE_OFFSET) 237 - #define PCI_AHBDOORBELL _IXP4XX_PCI_CSR(PCI_AHBDOORBELL_OFFSET) 238 - #define PCI_PCIDOORBELL _IXP4XX_PCI_CSR(PCI_PCIDOORBELL_OFFSET) 239 - #define PCI_ATPDMA0_AHBADDR _IXP4XX_PCI_CSR(PCI_ATPDMA0_AHBADDR_OFFSET) 240 - #define PCI_ATPDMA0_PCIADDR _IXP4XX_PCI_CSR(PCI_ATPDMA0_PCIADDR_OFFSET) 241 - #define PCI_ATPDMA0_LENADDR _IXP4XX_PCI_CSR(PCI_ATPDMA0_LENADDR_OFFSET) 242 - #define PCI_ATPDMA1_AHBADDR _IXP4XX_PCI_CSR(PCI_ATPDMA1_AHBADDR_OFFSET) 243 - #define PCI_ATPDMA1_PCIADDR _IXP4XX_PCI_CSR(PCI_ATPDMA1_PCIADDR_OFFSET) 244 - #define PCI_ATPDMA1_LENADDR _IXP4XX_PCI_CSR(PCI_ATPDMA1_LENADDR_OFFSET) 245 - 246 - /* 247 - * PCI register values and bit definitions 248 - */ 249 - 250 - /* CSR bit definitions */ 251 - #define PCI_CSR_HOST 0x00000001 252 - #define PCI_CSR_ARBEN 0x00000002 253 - #define PCI_CSR_ADS 0x00000004 254 - #define PCI_CSR_PDS 0x00000008 255 - #define PCI_CSR_ABE 0x00000010 256 - #define PCI_CSR_DBT 0x00000020 257 - #define PCI_CSR_ASE 0x00000100 258 - #define PCI_CSR_IC 0x00008000 259 - 260 - /* ISR (Interrupt status) Register bit definitions */ 261 - #define PCI_ISR_PSE 0x00000001 262 - #define PCI_ISR_PFE 0x00000002 263 - #define PCI_ISR_PPE 0x00000004 264 - #define PCI_ISR_AHBE 0x00000008 265 - #define PCI_ISR_APDC 0x00000010 266 - #define PCI_ISR_PADC 0x00000020 267 - #define PCI_ISR_ADB 0x00000040 268 - #define PCI_ISR_PDB 0x00000080 269 - 270 - /* INTEN (Interrupt Enable) Register bit definitions */ 271 - #define PCI_INTEN_PSE 0x00000001 272 - #define PCI_INTEN_PFE 0x00000002 273 - #define PCI_INTEN_PPE 0x00000004 274 - #define PCI_INTEN_AHBE 0x00000008 275 - #define PCI_INTEN_APDC 0x00000010 276 - #define PCI_INTEN_PADC 0x00000020 277 - #define PCI_INTEN_ADB 0x00000040 278 - #define PCI_INTEN_PDB 0x00000080 279 - 280 - /* 281 - * Shift value for byte enable on NP cmd/byte enable register 282 - */ 283 - #define IXP4XX_PCI_NP_CBE_BESL 4 284 - 285 - /* 286 - * PCI commands supported by NP access unit 287 - */ 288 - #define NP_CMD_IOREAD 0x2 289 - #define NP_CMD_IOWRITE 0x3 290 - #define NP_CMD_CONFIGREAD 0xa 291 - #define NP_CMD_CONFIGWRITE 0xb 292 - #define NP_CMD_MEMREAD 0x6 293 - #define NP_CMD_MEMWRITE 0x7 294 - 295 - /* 296 - * Constants for CRP access into local config space 297 - */ 298 - #define CRP_AD_CBE_BESL 20 299 - #define CRP_AD_CBE_WRITE 0x00010000 300 - 301 - #define DCMD_LENGTH 0x01fff /* length mask (max = 8K - 1) */ 302 - 303 - #endif
-98
arch/arm/mach-ixp4xx/include/mach/platform.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - /* 3 - * arch/arm/mach-ixp4xx/include/mach/platform.h 4 - * 5 - * Constants and functions that are useful to IXP4xx platform-specific code 6 - * and device drivers. 7 - * 8 - * Copyright (C) 2004 MontaVista Software, Inc. 9 - */ 10 - 11 - #ifndef __ASM_ARCH_HARDWARE_H__ 12 - #error "Do not include this directly, instead #include <mach/hardware.h>" 13 - #endif 14 - 15 - #ifndef __ASSEMBLY__ 16 - 17 - #include <linux/reboot.h> 18 - #include <linux/platform_data/eth_ixp4xx.h> 19 - 20 - #include <asm/types.h> 21 - 22 - #ifndef __ARMEB__ 23 - #define REG_OFFSET 0 24 - #else 25 - #define REG_OFFSET 3 26 - #endif 27 - 28 - /* 29 - * Expansion bus memory regions 30 - */ 31 - #define IXP4XX_EXP_BUS_BASE_PHYS (0x50000000) 32 - 33 - /* 34 - * The expansion bus on the IXP4xx can be configured for either 16 or 35 - * 32MB windows and the CS offset for each region changes based on the 36 - * current configuration. This means that we cannot simply hardcode 37 - * each offset. ixp4xx_sys_init() looks at the expansion bus configuration 38 - * as setup by the bootloader to determine our window size. 39 - */ 40 - extern unsigned long ixp4xx_exp_bus_size; 41 - 42 - #define IXP4XX_EXP_BUS_BASE(region)\ 43 - (IXP4XX_EXP_BUS_BASE_PHYS + ((region) * ixp4xx_exp_bus_size)) 44 - 45 - #define IXP4XX_EXP_BUS_END(region)\ 46 - (IXP4XX_EXP_BUS_BASE(region) + ixp4xx_exp_bus_size - 1) 47 - 48 - /* Those macros can be used to adjust timing and configure 49 - * other features for each region. 50 - */ 51 - 52 - #define IXP4XX_EXP_BUS_RECOVERY_T(x) (((x) & 0x0f) << 16) 53 - #define IXP4XX_EXP_BUS_HOLD_T(x) (((x) & 0x03) << 20) 54 - #define IXP4XX_EXP_BUS_STROBE_T(x) (((x) & 0x0f) << 22) 55 - #define IXP4XX_EXP_BUS_SETUP_T(x) (((x) & 0x03) << 26) 56 - #define IXP4XX_EXP_BUS_ADDR_T(x) (((x) & 0x03) << 28) 57 - #define IXP4XX_EXP_BUS_SIZE(x) (((x) & 0x0f) << 10) 58 - #define IXP4XX_EXP_BUS_CYCLES(x) (((x) & 0x03) << 14) 59 - 60 - #define IXP4XX_EXP_BUS_CS_EN (1L << 31) 61 - #define IXP4XX_EXP_BUS_BYTE_RD16 (1L << 6) 62 - #define IXP4XX_EXP_BUS_HRDY_POL (1L << 5) 63 - #define IXP4XX_EXP_BUS_MUX_EN (1L << 4) 64 - #define IXP4XX_EXP_BUS_SPLT_EN (1L << 3) 65 - #define IXP4XX_EXP_BUS_WR_EN (1L << 1) 66 - #define IXP4XX_EXP_BUS_BYTE_EN (1L << 0) 67 - 68 - #define IXP4XX_EXP_BUS_CYCLES_INTEL 0x00 69 - #define IXP4XX_EXP_BUS_CYCLES_MOTOROLA 0x01 70 - #define IXP4XX_EXP_BUS_CYCLES_HPI 0x02 71 - 72 - #define IXP4XX_FLASH_WRITABLE (0x2) 73 - #define IXP4XX_FLASH_DEFAULT (0xbcd23c40) 74 - #define IXP4XX_FLASH_WRITE (0xbcd23c42) 75 - 76 - /* 77 - * Clock Speed Definitions. 78 - */ 79 - #define IXP4XX_PERIPHERAL_BUS_CLOCK (66) /* 66MHzi APB BUS */ 80 - #define IXP4XX_UART_XTAL 14745600 81 - 82 - /* 83 - * Frequency of clock used for primary clocksource 84 - */ 85 - extern unsigned long ixp4xx_timer_freq; 86 - 87 - /* 88 - * Functions used by platform-level setup code 89 - */ 90 - extern void ixp4xx_map_io(void); 91 - extern void ixp4xx_init_early(void); 92 - extern void ixp4xx_init_irq(void); 93 - extern void ixp4xx_sys_init(void); 94 - extern void ixp4xx_timer_init(void); 95 - extern void ixp4xx_restart(enum reboot_mode, const char *); 96 - 97 - #endif // __ASSEMBLY__ 98 -
+3 -1
arch/arm/mach-ixp4xx/include/mach/uncompress.h
··· 9 9 #ifndef _ARCH_UNCOMPRESS_H_ 10 10 #define _ARCH_UNCOMPRESS_H_ 11 11 12 - #include "ixp4xx-regs.h" 13 12 #include <asm/mach-types.h> 14 13 #include <linux/serial_reg.h> 14 + 15 + #define IXP4XX_UART1_BASE_PHYS 0xc8000000 16 + #define IXP4XX_UART2_BASE_PHYS 0xc8001000 15 17 16 18 #define TX_DONE (UART_LSR_TEMT|UART_LSR_THRE) 17 19
-64
arch/arm/mach-ixp4xx/irqs.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* 3 - * arch/arm/mach-ixp4xx/include/mach/irqs.h 4 - * 5 - * IRQ definitions for IXP4XX based systems 6 - * 7 - * Copyright (C) 2002 Intel Corporation. 8 - * Copyright (C) 2003 MontaVista Software, Inc. 9 - */ 10 - 11 - #ifndef _ARCH_IXP4XX_IRQS_H_ 12 - #define _ARCH_IXP4XX_IRQS_H_ 13 - 14 - #define IRQ_IXP4XX_BASE 16 15 - 16 - #define IRQ_IXP4XX_NPEA (IRQ_IXP4XX_BASE + 0) 17 - #define IRQ_IXP4XX_NPEB (IRQ_IXP4XX_BASE + 1) 18 - #define IRQ_IXP4XX_NPEC (IRQ_IXP4XX_BASE + 2) 19 - #define IRQ_IXP4XX_QM1 (IRQ_IXP4XX_BASE + 3) 20 - #define IRQ_IXP4XX_QM2 (IRQ_IXP4XX_BASE + 4) 21 - #define IRQ_IXP4XX_TIMER1 (IRQ_IXP4XX_BASE + 5) 22 - #define IRQ_IXP4XX_GPIO0 (IRQ_IXP4XX_BASE + 6) 23 - #define IRQ_IXP4XX_GPIO1 (IRQ_IXP4XX_BASE + 7) 24 - #define IRQ_IXP4XX_PCI_INT (IRQ_IXP4XX_BASE + 8) 25 - #define IRQ_IXP4XX_PCI_DMA1 (IRQ_IXP4XX_BASE + 9) 26 - #define IRQ_IXP4XX_PCI_DMA2 (IRQ_IXP4XX_BASE + 10) 27 - #define IRQ_IXP4XX_TIMER2 (IRQ_IXP4XX_BASE + 11) 28 - #define IRQ_IXP4XX_USB (IRQ_IXP4XX_BASE + 12) 29 - #define IRQ_IXP4XX_UART2 (IRQ_IXP4XX_BASE + 13) 30 - #define IRQ_IXP4XX_TIMESTAMP (IRQ_IXP4XX_BASE + 14) 31 - #define IRQ_IXP4XX_UART1 (IRQ_IXP4XX_BASE + 15) 32 - #define IRQ_IXP4XX_WDOG (IRQ_IXP4XX_BASE + 16) 33 - #define IRQ_IXP4XX_AHB_PMU (IRQ_IXP4XX_BASE + 17) 34 - #define IRQ_IXP4XX_XSCALE_PMU (IRQ_IXP4XX_BASE + 18) 35 - #define IRQ_IXP4XX_GPIO2 (IRQ_IXP4XX_BASE + 19) 36 - #define IRQ_IXP4XX_GPIO3 (IRQ_IXP4XX_BASE + 20) 37 - #define IRQ_IXP4XX_GPIO4 (IRQ_IXP4XX_BASE + 21) 38 - #define IRQ_IXP4XX_GPIO5 (IRQ_IXP4XX_BASE + 22) 39 - #define IRQ_IXP4XX_GPIO6 (IRQ_IXP4XX_BASE + 23) 40 - #define IRQ_IXP4XX_GPIO7 (IRQ_IXP4XX_BASE + 24) 41 - #define IRQ_IXP4XX_GPIO8 (IRQ_IXP4XX_BASE + 25) 42 - #define IRQ_IXP4XX_GPIO9 (IRQ_IXP4XX_BASE + 26) 43 - #define IRQ_IXP4XX_GPIO10 (IRQ_IXP4XX_BASE + 27) 44 - #define IRQ_IXP4XX_GPIO11 (IRQ_IXP4XX_BASE + 28) 45 - #define IRQ_IXP4XX_GPIO12 (IRQ_IXP4XX_BASE + 29) 46 - #define IRQ_IXP4XX_SW_INT1 (IRQ_IXP4XX_BASE + 30) 47 - #define IRQ_IXP4XX_SW_INT2 (IRQ_IXP4XX_BASE + 31) 48 - #define IRQ_IXP4XX_USB_HOST (IRQ_IXP4XX_BASE + 32) 49 - #define IRQ_IXP4XX_I2C (IRQ_IXP4XX_BASE + 33) 50 - #define IRQ_IXP4XX_SSP (IRQ_IXP4XX_BASE + 34) 51 - #define IRQ_IXP4XX_TSYNC (IRQ_IXP4XX_BASE + 35) 52 - #define IRQ_IXP4XX_EAU_DONE (IRQ_IXP4XX_BASE + 36) 53 - #define IRQ_IXP4XX_SHA_DONE (IRQ_IXP4XX_BASE + 37) 54 - #define IRQ_IXP4XX_SWCP_PE (IRQ_IXP4XX_BASE + 58) 55 - #define IRQ_IXP4XX_QM_PE (IRQ_IXP4XX_BASE + 60) 56 - #define IRQ_IXP4XX_MCU_ECC (IRQ_IXP4XX_BASE + 61) 57 - #define IRQ_IXP4XX_EXP_PE (IRQ_IXP4XX_BASE + 62) 58 - 59 - #define _IXP4XX_GPIO_IRQ(n) (IRQ_IXP4XX_GPIO ## n) 60 - #define IXP4XX_GPIO_IRQ(n) _IXP4XX_GPIO_IRQ(n) 61 - 62 - #define XSCALE_PMU_IRQ (IRQ_IXP4XX_XSCALE_PMU) 63 - 64 - #endif
-1
drivers/crypto/ixp4xx_crypto.c
··· 33 33 34 34 /* Intermittent includes, delete this after v5.14-rc1 */ 35 35 #include <linux/soc/ixp4xx/cpu.h> 36 - #include <mach/ixp4xx-regs.h> 37 36 38 37 #define MAX_KEYLEN 32 39 38
-1
drivers/net/ethernet/xscale/ptp_ixp46x.c
··· 16 16 #include <linux/ptp_clock_kernel.h> 17 17 #include <linux/platform_device.h> 18 18 #include <linux/soc/ixp4xx/cpu.h> 19 - #include <mach/ixp4xx-regs.h> 20 19 21 20 #include "ixp46x_ts.h" 22 21