2 * arch/blackfin/mach-common/scb-init.c - reprogram system cross bar priority
4 * Copyright 2012 Analog Devices Inc.
6 * Licensed under the GPL-2 or later.
9 #include <linux/errno.h>
10 #include <linux/kernel.h>
13 __attribute__((l1_text
))
14 inline void scb_mi_write(unsigned long scb_mi_arbw
, unsigned int slots
,
15 unsigned char *scb_mi_prio
)
19 for (i
= 0; i
< slots
; ++i
)
20 bfin_write32(scb_mi_arbw
, (i
<< SCB_SLOT_OFFSET
) | scb_mi_prio
[i
]);
23 __attribute__((l1_text
))
24 inline void scb_mi_read(unsigned long scb_mi_arbw
, unsigned int slots
,
25 unsigned char *scb_mi_prio
)
29 for (i
= 0; i
< slots
; ++i
) {
30 bfin_write32(scb_mi_arbw
, (0xFF << SCB_SLOT_OFFSET
) | i
);
31 scb_mi_prio
[i
] = bfin_read32(scb_mi_arbw
);
35 __attribute__((l1_text
))
39 unsigned char scb_tmp_prio
[32];
41 pr_info("Init System Crossbar\n");
42 for (i
= 0; scb_data
[i
].scb_mi_arbr
> 0; ++i
) {
44 scb_mi_write(scb_data
[i
].scb_mi_arbw
, scb_data
[i
].scb_mi_slots
, scb_data
[i
].scb_mi_prio
);
46 pr_debug("scb priority at 0x%lx:\n", scb_data
[i
].scb_mi_arbr
);
47 scb_mi_read(scb_data
[i
].scb_mi_arbw
, scb_data
[i
].scb_mi_slots
, scb_tmp_prio
);
48 for (j
= 0; j
< scb_data
[i
].scb_mi_slots
; ++j
)
49 pr_debug("slot %d = %d\n", j
, scb_tmp_prio
[j
]);