Remove bus_dma_get_range and bus_dma_get_range_nb on armv6. We only need

this on a few earlier arm SoCs.

Reviewed by:	manu (earlier version)
Sponsored by:	ABT Systems Ltd
This commit is contained in:
Andrew Turner 2016-09-23 12:38:05 +00:00
parent 7402f93ef2
commit c35b5d8372
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=306262
18 changed files with 3 additions and 251 deletions

View File

@ -36,7 +36,6 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#define _ARM32_BUS_DMA_PRIVATE
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
@ -147,18 +146,6 @@ allwinner_devmap_init(platform_t plat)
return (0);
}
struct arm32_dma_range *
bus_dma_get_range(void)
{
return (NULL);
}
int
bus_dma_get_range_nb(void)
{
return (0);
}
void
cpu_reset()
{

View File

@ -34,7 +34,6 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#define _ARM32_BUS_DMA_PRIVATE
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
@ -100,17 +99,3 @@ platform_devmap_init(void)
return (0);
}
struct arm32_dma_range *
bus_dma_get_range(void)
{
return (NULL);
}
int
bus_dma_get_range_nb(void)
{
return (0);
}

View File

@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$");
#include "opt_platform.h"
#define _ARM32_BUS_DMA_PRIVATE
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
@ -166,20 +165,6 @@ platform_devmap_init(void)
return (0);
}
struct arm32_dma_range *
bus_dma_get_range(void)
{
return (NULL);
}
int
bus_dma_get_range_nb(void)
{
return (0);
}
struct fdt_fixup_entry fdt_fixup_table[] = {
{ NULL, NULL }
};

View File

@ -29,7 +29,6 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#define _ARM32_BUS_DMA_PRIVATE
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
@ -92,17 +91,3 @@ platform_devmap_init(void)
devmap_add_entry(al_devmap_pa, al_devmap_size);
return (0);
}
struct arm32_dma_range *
bus_dma_get_range(void)
{
return (NULL);
}
int
bus_dma_get_range_nb(void)
{
return (0);
}

View File

@ -33,7 +33,6 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#define _ARM32_BUS_DMA_PRIVATE
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/malloc.h>
@ -95,14 +94,6 @@ struct bus_dma_tag {
bus_dma_lock_t *lockfunc;
void *lockfuncarg;
struct bounce_zone *bounce_zone;
/*
* DMA range for this tag. If the page doesn't fall within
* one of these ranges, an error is returned. The caller
* may then decide what to do with the transfer. If the
* range pointer is NULL, it is ignored.
*/
struct arm32_dma_range *ranges;
int _nranges;
};
struct bounce_page {
@ -407,22 +398,6 @@ must_bounce(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t paddr,
return (0);
}
static __inline struct arm32_dma_range *
_bus_dma_inrange(struct arm32_dma_range *ranges, int nranges,
bus_addr_t curaddr)
{
struct arm32_dma_range *dr;
int i;
for (i = 0, dr = ranges; i < nranges; i++, dr++) {
if (curaddr >= dr->dr_sysbase &&
round_page(curaddr) <= (dr->dr_sysbase + dr->dr_len))
return (dr);
}
return (NULL);
}
/*
* Convenience function for manipulating driver locks from busdma (during
* busdma_swi, for example). Drivers that don't provide their own locks
@ -507,8 +482,6 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
newtag->flags = flags;
newtag->ref_count = 1; /* Count ourself */
newtag->map_count = 0;
newtag->ranges = bus_dma_get_range();
newtag->_nranges = bus_dma_get_range_nb();
if (lockfunc != NULL) {
newtag->lockfunc = lockfunc;
newtag->lockfuncarg = lockfuncarg;
@ -992,22 +965,6 @@ _bus_dmamap_addseg(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t curaddr,
sgsize = (baddr - curaddr);
}
if (dmat->ranges) {
struct arm32_dma_range *dr;
dr = _bus_dma_inrange(dmat->ranges, dmat->_nranges,
curaddr);
if (dr == NULL) {
_bus_dmamap_unload(dmat, map);
return (0);
}
/*
* In a valid DMA range. Translate the physical
* memory address to an address in the DMA window.
*/
curaddr = (curaddr - dr->dr_sysbase) + dr->dr_busbase;
}
/*
* Insert chunk into a segment, coalescing with
* previous segment if possible.

View File

@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$");
* through a previously registered kernel object.
*/
#define _ARM32_BUS_DMA_PRIVATE
#include <sys/param.h>
#include <sys/bus.h>
#include <sys/kernel.h>

View File

@ -42,7 +42,6 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#define _ARM32_BUS_DMA_PRIVATE
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
@ -113,19 +112,7 @@ bcm2836_devmap_init(platform_t plat)
}
#endif
struct arm32_dma_range *
bus_dma_get_range(void)
{
return (NULL);
}
int
bus_dma_get_range_nb(void)
{
return (0);
}
void
cpu_reset()

View File

@ -29,7 +29,6 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#define _ARM32_BUS_DMA_PRIVATE
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/reboot.h>
@ -54,20 +53,6 @@ SYSCTL_UINT(_hw_imx, OID_AUTO, last_reset_status, CTLFLAG_RD,
SYSCTL_STRING(_hw_imx, OID_AUTO, last_reset_reason, CTLFLAG_RD,
"unknown", 0, "Last reset reason");
struct arm32_dma_range *
bus_dma_get_range(void)
{
return (NULL);
}
int
bus_dma_get_range_nb(void)
{
return (0);
}
/*
* This code which manipulates the watchdog hardware is here to implement
* cpu_reset() because the watchdog is the only way for software to reset the

View File

@ -30,7 +30,6 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#define _ARM32_BUS_DMA_PRIVATE
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
@ -78,17 +77,3 @@ platform_devmap_init(void)
return (0);
}
struct arm32_dma_range *
bus_dma_get_range(void)
{
return (NULL);
}
int
bus_dma_get_range_nb(void)
{
return (0);
}

View File

@ -72,7 +72,7 @@
#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0)
#ifdef _ARM32_BUS_DMA_PRIVATE
#if defined(_ARM32_BUS_DMA_PRIVATE) && __ARM_ARCH < 6
/*
* arm32_dma_range
*

View File

@ -432,6 +432,7 @@ platform_devmap_init(void)
return (0);
}
#if __ARM_ARCH < 6
struct arm32_dma_range *
bus_dma_get_range(void)
{
@ -445,6 +446,7 @@ bus_dma_get_range_nb(void)
return (0);
}
#endif
#if defined(CPU_MV_PJ4B)
#ifdef DDB

View File

@ -24,7 +24,6 @@
* SUCH DAMAGE.
*/
#define _ARM32_BUS_DMA_PRIVATE
#include "opt_platform.h"
#include <sys/cdefs.h>
@ -66,20 +65,6 @@ struct fdt_fixup_entry fdt_fixup_table[] = {
{ NULL, NULL }
};
struct arm32_dma_range *
bus_dma_get_range(void)
{
return (NULL);
}
int
bus_dma_get_range_nb(void)
{
return (0);
}
static vm_offset_t
tegra124_lastaddr(platform_t plat)
{

View File

@ -30,7 +30,6 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#define _ARM32_BUS_DMA_PRIVATE
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/devmap.h>
@ -45,20 +44,6 @@ __FBSDID("$FreeBSD$");
#include "platform_if.h"
struct arm32_dma_range *
bus_dma_get_range(void)
{
return (NULL);
}
int
bus_dma_get_range_nb(void)
{
return (0);
}
void
cpu_reset(void)
{

View File

@ -34,7 +34,6 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#define _ARM32_BUS_DMA_PRIVATE
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
@ -92,20 +91,6 @@ platform_devmap_init(void)
return (0);
}
struct arm32_dma_range *
bus_dma_get_range(void)
{
return (NULL);
}
int
bus_dma_get_range_nb(void)
{
return (0);
}
void
cpu_reset()
{

View File

@ -30,7 +30,6 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#define _ARM32_BUS_DMA_PRIVATE
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
@ -83,17 +82,3 @@ platform_devmap_init(void)
return (0);
}
struct arm32_dma_range *
bus_dma_get_range(void)
{
return (NULL);
}
int
bus_dma_get_range_nb(void)
{
return (0);
}

View File

@ -40,7 +40,6 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#define _ARM32_BUS_DMA_PRIVATE
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
@ -96,20 +95,6 @@ ti_am335x_devmap_init(platform_t plat)
}
#endif
struct arm32_dma_range *
bus_dma_get_range(void)
{
return (NULL);
}
int
bus_dma_get_range_nb(void)
{
return (0);
}
void
cpu_reset()
{

View File

@ -39,7 +39,6 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#define _ARM32_BUS_DMA_PRIVATE
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
@ -102,20 +101,6 @@ platform_devmap_init(void)
return (0);
}
struct arm32_dma_range *
bus_dma_get_range(void)
{
return (NULL);
}
int
bus_dma_get_range_nb(void)
{
return (0);
}
void
cpu_reset()
{

View File

@ -36,7 +36,6 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#define _ARM32_BUS_DMA_PRIVATE
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
@ -120,20 +119,6 @@ fdt_pic_decode_t fdt_pic_table[] = {
};
#endif
struct arm32_dma_range *
bus_dma_get_range(void)
{
return (NULL);
}
int
bus_dma_get_range_nb(void)
{
return (0);
}
void
cpu_reset()
{