Changeset View
Changeset View
Standalone View
Standalone View
head/sys/arm/mv/mv_common.c
Show First 20 Lines • Show All 122 Lines • ▼ Show 20 Lines | |||||
static int win_cpu_from_dt(void); | static int win_cpu_from_dt(void); | ||||
static int fdt_win_setup(void); | static int fdt_win_setup(void); | ||||
static uint32_t dev_mask = 0; | static uint32_t dev_mask = 0; | ||||
static int cpu_wins_no = 0; | static int cpu_wins_no = 0; | ||||
static int eth_port = 0; | static int eth_port = 0; | ||||
static int usb_port = 0; | static int usb_port = 0; | ||||
static boolean_t platform_io_coherent = false; | |||||
static struct decode_win cpu_win_tbl[MAX_CPU_WIN]; | static struct decode_win cpu_win_tbl[MAX_CPU_WIN]; | ||||
const struct decode_win *cpu_wins = cpu_win_tbl; | const struct decode_win *cpu_wins = cpu_win_tbl; | ||||
typedef void (*decode_win_setup_t)(u_long); | typedef void (*decode_win_setup_t)(u_long); | ||||
typedef void (*dump_win_t)(u_long); | typedef void (*dump_win_t)(u_long); | ||||
▲ Show 20 Lines • Show All 920 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
return ((ddr_sz_read(i) | 0x00ffffff) + 1); | return ((ddr_sz_read(i) | 0x00ffffff) + 1); | ||||
} | } | ||||
uint32_t | uint32_t | ||||
ddr_attr(int i) | ddr_attr(int i) | ||||
{ | { | ||||
uint32_t dev, rev; | uint32_t dev, rev, attr; | ||||
soc_id(&dev, &rev); | soc_id(&dev, &rev); | ||||
if (dev == MV_DEV_88RC8180) | if (dev == MV_DEV_88RC8180) | ||||
return ((ddr_sz_read(i) & 0xf0) >> 4); | return ((ddr_sz_read(i) & 0xf0) >> 4); | ||||
if (dev == MV_DEV_88F6781) | if (dev == MV_DEV_88F6781) | ||||
return (0); | return (0); | ||||
return (i == 0 ? 0xe : | attr = (i == 0 ? 0xe : | ||||
(i == 1 ? 0xd : | (i == 1 ? 0xd : | ||||
(i == 2 ? 0xb : | (i == 2 ? 0xb : | ||||
(i == 3 ? 0x7 : 0xff)))); | (i == 3 ? 0x7 : 0xff)))); | ||||
if (platform_io_coherent) | |||||
attr |= 0x10; | |||||
return (attr); | |||||
} | } | ||||
uint32_t | uint32_t | ||||
ddr_target(int i) | ddr_target(int i) | ||||
{ | { | ||||
uint32_t dev, rev; | uint32_t dev, rev; | ||||
soc_id(&dev, &rev); | soc_id(&dev, &rev); | ||||
▲ Show 20 Lines • Show All 1,386 Lines • ▼ Show 20 Lines | fdt_win_setup(void) | ||||
phandle_t node, child, sb; | phandle_t node, child, sb; | ||||
phandle_t child_pci; | phandle_t child_pci; | ||||
int err; | int err; | ||||
sb = 0; | sb = 0; | ||||
node = OF_finddevice("/"); | node = OF_finddevice("/"); | ||||
if (node == -1) | if (node == -1) | ||||
panic("fdt_win_setup: no root node"); | panic("fdt_win_setup: no root node"); | ||||
/* Allow for coherent transactions on the A38x MBUS */ | |||||
if (ofw_bus_node_is_compatible(node, "marvell,armada380")) | |||||
platform_io_coherent = true; | |||||
/* | /* | ||||
* Traverse through all children of root and simple-bus nodes. | * Traverse through all children of root and simple-bus nodes. | ||||
* For each found device retrieve decode windows data (if applicable). | * For each found device retrieve decode windows data (if applicable). | ||||
*/ | */ | ||||
child = OF_child(node); | child = OF_child(node); | ||||
while (child != 0) { | while (child != 0) { | ||||
/* Lookup for callback and run */ | /* Lookup for callback and run */ | ||||
▲ Show 20 Lines • Show All 192 Lines • Show Last 20 Lines |