cregit-Linux how code gets into the kernel

Release 4.16 drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c

// SPDX-License-Identifier: GPL-2.0+
/*
 *  Driver for CPM (SCC/SMC) serial ports; CPM1 definitions
 *
 *  Maintainer: Kumar Gala (galak@kernel.crashing.org) (CPM2)
 *              Pantelis Antoniou (panto@intracom.gr) (CPM1)
 *
 *  Copyright (C) 2004 Freescale Semiconductor, Inc.
 *            (C) 2004 Intracom, S.A.
 *            (C) 2006 MontaVista Software, Inc.
 *              Vitaly Bordug <vbordug@ru.mvista.com>
 */

#include <linux/module.h>
#include <linux/tty.h>
#include <linux/gfp.h>
#include <linux/ioport.h>
#include <linux/serial.h>
#include <linux/console.h>
#include <linux/sysrq.h>
#include <linux/device.h>
#include <linux/bootmem.h>
#include <linux/dma-mapping.h>

#include <asm/io.h>
#include <asm/irq.h>
#include <asm/fs_pd.h>

#include <linux/serial_core.h>
#include <linux/kernel.h>

#include <linux/of.h>
#include <linux/of_address.h>

#include "cpm_uart.h"

/**************************************************************/


void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd) { cpm_command(port->command, cmd); }

Contributors

PersonTokensPropCommitsCommitProp
Scott Wood1672.73%133.33%
David Woodhouse418.18%133.33%
Jochen Friedrich29.09%133.33%
Total22100.00%3100.00%


void __iomem *cpm_uart_map_pram(struct uart_cpm_port *port, struct device_node *np) { return of_iomap(np, 1); }

Contributors

PersonTokensPropCommitsCommitProp
Laurent Pinchart25100.00%1100.00%
Total25100.00%1100.00%


void cpm_uart_unmap_pram(struct uart_cpm_port *port, void __iomem *pram) { iounmap(pram); }

Contributors

PersonTokensPropCommitsCommitProp
Laurent Pinchart20100.00%1100.00%
Total20100.00%1100.00%

/* * Allocate DP-Ram and memory buffers. We need to allocate a transmit and * receive buffer descriptors from dual port ram, and a character * buffer area from host mem. If we are allocating for the console we need * to do it from bootmem */
int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) { int dpmemsz, memsz; u8 *dp_mem; unsigned long dp_offset; u8 *mem_addr; dma_addr_t dma_addr = 0; pr_debug("CPM uart[%d]:allocbuf\n", pinfo->port.line); dpmemsz = sizeof(cbd_t) * (pinfo->rx_nrfifos + pinfo->tx_nrfifos); dp_offset = cpm_dpalloc(dpmemsz, 8); if (IS_ERR_VALUE(dp_offset)) { printk(KERN_ERR "cpm_uart_cpm1.c: could not allocate buffer descriptors\n"); return -ENOMEM; } dp_mem = cpm_dpram_addr(dp_offset); memsz = L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) + L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize); if (is_con) { /* was hostalloc but changed cause it blows away the */ /* large tlb mapping when pinning the kernel area */ mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8)); dma_addr = (u32)cpm_dpram_phys(mem_addr); } else mem_addr = dma_alloc_coherent(pinfo->port.dev, memsz, &dma_addr, GFP_KERNEL); if (mem_addr == NULL) { cpm_dpfree(dp_offset); printk(KERN_ERR "cpm_uart_cpm1.c: could not allocate coherent memory\n"); return -ENOMEM; } pinfo->dp_addr = dp_offset; pinfo->mem_addr = mem_addr; /* virtual address*/ pinfo->dma_addr = dma_addr; /* physical address*/ pinfo->mem_size = memsz; pinfo->rx_buf = mem_addr; pinfo->tx_buf = pinfo->rx_buf + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize); pinfo->rx_bd_base = (cbd_t __iomem __force *)dp_mem; pinfo->tx_bd_base = pinfo->rx_bd_base + pinfo->rx_nrfifos; return 0; }

Contributors

PersonTokensPropCommitsCommitProp
David Woodhouse21477.26%19.09%
Kumar Gala186.50%218.18%
Vitaly Bordug155.42%218.18%
Tom Rini145.05%218.18%
Marcelo Tosatti62.17%19.09%
Becky Bruce51.81%19.09%
Timur Tabi31.08%19.09%
Scott Wood20.72%19.09%
Total277100.00%11100.00%


void cpm_uart_freebuf(struct uart_cpm_port *pinfo) { dma_free_coherent(pinfo->port.dev, L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) + L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize), pinfo->mem_addr, pinfo->dma_addr); cpm_dpfree(pinfo->dp_addr); }

Contributors

PersonTokensPropCommitsCommitProp
David Woodhouse3766.07%120.00%
Tom Rini1323.21%240.00%
Becky Bruce58.93%120.00%
Kumar Gala11.79%120.00%
Total56100.00%5100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
David Woodhouse29865.07%15.56%
Laurent Pinchart4810.48%15.56%
Tom Rini275.90%211.11%
Kumar Gala204.37%211.11%
Vitaly Bordug183.93%211.11%
Scott Wood183.93%211.11%
Becky Bruce102.18%15.56%
Marcelo Tosatti61.31%15.56%
Tejun Heo30.66%15.56%
Timur Tabi30.66%15.56%
Rob Herring30.66%15.56%
Greg Kroah-Hartman20.44%211.11%
Jochen Friedrich20.44%15.56%
Total458100.00%18100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.