cpm1.c (b38736ac01e34491f339e12f9883dc4a8cc3d358) | cpm1.c (a99cc66807d6c854a7f65f962766c530c91be149) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * General Purpose functions for the global management of the 4 * Communication Processor Module. 5 * Copyright (c) 1997 Dan error_act (dmalek@jlc.net) 6 * 7 * In addition to the individual control of the communication 8 * channels, there are a few functions that globally affect the --- 30 unchanged lines hidden (view full) --- 39#include <asm/cpm1.h> 40#include <asm/io.h> 41#include <asm/rheap.h> 42#include <asm/cpm.h> 43 44#include <asm/fs_pd.h> 45 46#ifdef CONFIG_8xx_GPIO | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * General Purpose functions for the global management of the 4 * Communication Processor Module. 5 * Copyright (c) 1997 Dan error_act (dmalek@jlc.net) 6 * 7 * In addition to the individual control of the communication 8 * channels, there are a few functions that globally affect the --- 30 unchanged lines hidden (view full) --- 39#include <asm/cpm1.h> 40#include <asm/io.h> 41#include <asm/rheap.h> 42#include <asm/cpm.h> 43 44#include <asm/fs_pd.h> 45 46#ifdef CONFIG_8xx_GPIO |
47#include <linux/of_gpio.h> | 47#include <linux/gpio/legacy-of-mm-gpiochip.h> |
48#endif 49 50#define CPM_MAP_SIZE (0x4000) 51 52cpm8xx_t __iomem *cpmp; /* Pointer to comm processor space */ 53immap_t __iomem *mpc8xx_immr = (void __iomem *)VIRT_IMMR_BASE; 54 55void __init cpm_reset(void) --- 33 unchanged lines hidden (view full) --- 89 90#define MAX_CR_CMD_LOOPS 10000 91 92int cpm_command(u32 command, u8 opcode) 93{ 94 int i, ret; 95 unsigned long flags; 96 | 48#endif 49 50#define CPM_MAP_SIZE (0x4000) 51 52cpm8xx_t __iomem *cpmp; /* Pointer to comm processor space */ 53immap_t __iomem *mpc8xx_immr = (void __iomem *)VIRT_IMMR_BASE; 54 55void __init cpm_reset(void) --- 33 unchanged lines hidden (view full) --- 89 90#define MAX_CR_CMD_LOOPS 10000 91 92int cpm_command(u32 command, u8 opcode) 93{ 94 int i, ret; 95 unsigned long flags; 96 |
97 if (command & 0xffffff03) | 97 if (command & 0xffffff0f) |
98 return -EINVAL; 99 100 spin_lock_irqsave(&cmd_lock, flags); 101 102 ret = 0; 103 out_be16(&cpmp->cp_cpcr, command | CPM_CR_FLG | (opcode << 8)); 104 for (i = 0; i < MAX_CR_CMD_LOOPS; i++) 105 if ((in_be16(&cpmp->cp_cpcr) & CPM_CR_FLG) == 0) --- 535 unchanged lines hidden --- | 98 return -EINVAL; 99 100 spin_lock_irqsave(&cmd_lock, flags); 101 102 ret = 0; 103 out_be16(&cpmp->cp_cpcr, command | CPM_CR_FLG | (opcode << 8)); 104 for (i = 0; i < MAX_CR_CMD_LOOPS; i++) 105 if ((in_be16(&cpmp->cp_cpcr) & CPM_CR_FLG) == 0) --- 535 unchanged lines hidden --- |