if_cpsw.c (246276) | if_cpsw.c (248407) |
---|---|
1/*- 2 * Copyright (c) 2012 Damjan Marion <dmarion@Freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 30 unchanged lines hidden (view full) --- 39 * the slivers and the Address Lookup Engine (ALE) that routes packets 40 * between the ports. 41 * 42 * This code was developed and tested on a BeagleBone with 43 * an AM335x SoC. 44 */ 45 46#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2012 Damjan Marion <dmarion@Freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 30 unchanged lines hidden (view full) --- 39 * the slivers and the Address Lookup Engine (ALE) that routes packets 40 * between the ports. 41 * 42 * This code was developed and tested on a BeagleBone with 43 * an AM335x SoC. 44 */ 45 46#include <sys/cdefs.h> |
47__FBSDID("$FreeBSD: head/sys/arm/ti/cpsw/if_cpsw.c 246276 2013-02-03 01:08:01Z kientzle $"); | 47__FBSDID("$FreeBSD: head/sys/arm/ti/cpsw/if_cpsw.c 248407 2013-03-17 03:04:43Z ian $"); |
48 49#include <sys/param.h> 50#include <sys/systm.h> 51#include <sys/endian.h> 52#include <sys/mbuf.h> 53#include <sys/lock.h> 54#include <sys/mutex.h> 55#include <sys/kernel.h> --- 266 unchanged lines hidden (view full) --- 322 * Read/Write macros 323 */ 324#define cpsw_read_4(sc, reg) bus_read_4(sc->res[0], reg) 325#define cpsw_write_4(sc, reg, val) bus_write_4(sc->res[0], reg, val) 326 327#define cpsw_cpdma_bd_offset(i) (CPSW_CPPI_RAM_OFFSET + ((i)*16)) 328 329#define cpsw_cpdma_bd_paddr(sc, slot) \ | 48 49#include <sys/param.h> 50#include <sys/systm.h> 51#include <sys/endian.h> 52#include <sys/mbuf.h> 53#include <sys/lock.h> 54#include <sys/mutex.h> 55#include <sys/kernel.h> --- 266 unchanged lines hidden (view full) --- 322 * Read/Write macros 323 */ 324#define cpsw_read_4(sc, reg) bus_read_4(sc->res[0], reg) 325#define cpsw_write_4(sc, reg, val) bus_write_4(sc->res[0], reg, val) 326 327#define cpsw_cpdma_bd_offset(i) (CPSW_CPPI_RAM_OFFSET + ((i)*16)) 328 329#define cpsw_cpdma_bd_paddr(sc, slot) \ |
330 (slot->bd_offset + vtophys(rman_get_start(sc->res[0]))) | 330 BUS_SPACE_PHYSADDR(sc->res[0], slot->bd_offset) |
331#define cpsw_cpdma_read_bd(sc, slot, val) \ 332 bus_read_region_4(sc->res[0], slot->bd_offset, (uint32_t *) val, 4) 333#define cpsw_cpdma_write_bd(sc, slot, val) \ 334 bus_write_region_4(sc->res[0], slot->bd_offset, (uint32_t *) val, 4) 335#define cpsw_cpdma_write_bd_next(sc, slot, next_slot) \ 336 cpsw_write_4(sc, slot->bd_offset, cpsw_cpdma_bd_paddr(sc, next_slot)) 337#define cpsw_cpdma_read_bd_flags(sc, slot) \ 338 bus_read_2(sc->res[0], slot->bd_offset + 14) --- 1846 unchanged lines hidden --- | 331#define cpsw_cpdma_read_bd(sc, slot, val) \ 332 bus_read_region_4(sc->res[0], slot->bd_offset, (uint32_t *) val, 4) 333#define cpsw_cpdma_write_bd(sc, slot, val) \ 334 bus_write_region_4(sc->res[0], slot->bd_offset, (uint32_t *) val, 4) 335#define cpsw_cpdma_write_bd_next(sc, slot, next_slot) \ 336 cpsw_write_4(sc, slot->bd_offset, cpsw_cpdma_bd_paddr(sc, next_slot)) 337#define cpsw_cpdma_read_bd_flags(sc, slot) \ 338 bus_read_2(sc->res[0], slot->bd_offset + 14) --- 1846 unchanged lines hidden --- |