Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/mv/mv_machdep.c
Show All 40 Lines | |||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#define _ARM32_BUS_DMA_PRIVATE | #define _ARM32_BUS_DMA_PRIVATE | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/bus.h> | #include <sys/bus.h> | ||||
#include <sys/devmap.h> | #include <sys/devmap.h> | ||||
#include <sys/kernel.h> | |||||
#include <vm/vm.h> | #include <vm/vm.h> | ||||
#include <vm/pmap.h> | #include <vm/pmap.h> | ||||
#include <arm/arm/nexusvar.h> | |||||
#include <machine/bus.h> | #include <machine/bus.h> | ||||
#include <machine/fdt.h> | #include <machine/fdt.h> | ||||
#include <machine/machdep.h> | #include <machine/machdep.h> | ||||
#include <machine/platform.h> | #include <machine/platform.h> | ||||
#if __ARM_ARCH < 6 | #if __ARM_ARCH < 6 | ||||
#include <machine/cpu-v4.h> | #include <machine/cpu-v4.h> | ||||
#else | #else | ||||
Show All 20 Lines | |||||
int armada38x_mbus_optimization(void); | int armada38x_mbus_optimization(void); | ||||
#endif | #endif | ||||
#define MPP_PIN_MAX 68 | #define MPP_PIN_MAX 68 | ||||
#define MPP_PIN_CELLS 2 | #define MPP_PIN_CELLS 2 | ||||
#define MPP_PINS_PER_REG 8 | #define MPP_PINS_PER_REG 8 | ||||
#define MPP_SEL(pin,func) (((func) & 0xf) << \ | #define MPP_SEL(pin,func) (((func) & 0xf) << \ | ||||
(((pin) % MPP_PINS_PER_REG) * 4)) | (((pin) % MPP_PINS_PER_REG) * 4)) | ||||
static void | |||||
mv_busdma_tag_init(void *arg __unused) | |||||
{ | |||||
phandle_t node; | |||||
bus_dma_tag_t dmat; | |||||
/* | |||||
* If this platform has coherent DMA, create the parent DMA tag to pass | |||||
* down the coherent flag to all busses and devices on the platform, | |||||
* otherwise return without doing anything. By default create tag | |||||
* for all A38x-based platforms only. | |||||
*/ | |||||
if ((node = OF_finddevice("/")) == -1) | |||||
return; | |||||
if (ofw_bus_node_is_compatible(node, "marvell,armada380") == 0) | |||||
return; | |||||
bus_dma_tag_create(NULL, /* No parent tag */ | |||||
1, 0, /* alignment, bounds */ | |||||
BUS_SPACE_MAXADDR, /* lowaddr */ | |||||
BUS_SPACE_MAXADDR, /* highaddr */ | |||||
NULL, NULL, /* filter, filterarg */ | |||||
BUS_SPACE_MAXSIZE, /* maxsize */ | |||||
BUS_SPACE_UNRESTRICTED, /* nsegments */ | |||||
BUS_SPACE_MAXSIZE, /* maxsegsize */ | |||||
BUS_DMA_COHERENT, /* flags */ | |||||
NULL, NULL, /* lockfunc, lockarg */ | |||||
&dmat); | |||||
nexus_set_dma_tag(dmat); | |||||
} | |||||
SYSINIT(mv_busdma_tag, SI_SUB_DRIVERS, SI_ORDER_ANY, mv_busdma_tag_init, NULL); | |||||
static int | static int | ||||
platform_mpp_init(void) | platform_mpp_init(void) | ||||
{ | { | ||||
pcell_t pinmap[MPP_PIN_MAX * MPP_PIN_CELLS]; | pcell_t pinmap[MPP_PIN_MAX * MPP_PIN_CELLS]; | ||||
int mpp[MPP_PIN_MAX]; | int mpp[MPP_PIN_MAX]; | ||||
uint32_t ctrl_val, ctrl_offset; | uint32_t ctrl_val, ctrl_offset; | ||||
pcell_t reg[4]; | pcell_t reg[4]; | ||||
▲ Show 20 Lines • Show All 417 Lines • Show Last 20 Lines |