Index: sys/arm/mv/mv_common.c =================================================================== --- sys/arm/mv/mv_common.c +++ sys/arm/mv/mv_common.c @@ -128,6 +128,7 @@ static int cpu_wins_no = 0; static int eth_port = 0; static int usb_port = 0; +static boolean_t plat_dma_coherent = false; static struct decode_win cpu_win_tbl[MAX_CPU_WIN]; @@ -573,6 +574,7 @@ { uint32_t dev, rev; int mask, err; + phandle_t node; mask = 0; TUNABLE_INT_FETCH("hw.pm-disable-mask", &mask); @@ -587,6 +589,11 @@ /* Retrieve our ID: some windows facilities vary between SoC models */ soc_id(&dev, &rev); + /* Retrieve information about DMA coherency from device tree */ + node = OF_finddevice("/soc"); + if ((node > 0) && OF_hasprop(node, "dma-coherent")) + plat_dma_coherent = true; + #ifdef SOC_MV_ARMADAXP if ((err = decode_win_sdram_fixup()) != 0) return(err); @@ -1064,7 +1071,7 @@ uint32_t ddr_attr(int i) { - uint32_t dev, rev; + uint32_t dev, rev, attr; soc_id(&dev, &rev); if (dev == MV_DEV_88RC8180) @@ -1072,10 +1079,14 @@ if (dev == MV_DEV_88F6781) return (0); - return (i == 0 ? 0xe : + attr = (i == 0 ? 0xe : (i == 1 ? 0xd : (i == 2 ? 0xb : (i == 3 ? 0x7 : 0xff)))); + if (plat_dma_coherent) + attr |= 0x10; + + return (attr); } uint32_t